Howto retrieve the running qt version in qt5? - qt5

I want to know the version of Qt my app is currently running with?
Not the aboutQt Dialog of QMessageBox or QApplication!
Is there a string or a int which defines the Qt version?
Or any API call?
I'm using Qt 5.4.1.
Thanks!

You may use the global qVersion function: http://doc.qt.io/qt-5/qtglobal.html#qVersion
const char * qVersion()
Returns the version number of Qt at run-time as a string (for example, "4.1.2"). This may be a different version than the version the application was compiled against.

Related

EnterpriseLibraryContainer.Current.GetInstance() equivalent Updating Project from Enterprise Library 5 to 6

Alrighty, so I'm working on an older application that was built using Enterprise Library 5 and am updating it to use the latest version (6.0.1304). However, I'm running into an issue in a few of the data access pieces that are trying to use EnterpriseLibraryContainer like so:
EnterpriseLibraryContainer.GetInstance(Of Database)(ConfigurationManager.ConnectionStrings("SomeDatabaseWeUse").Name)
My question is, what is an example of replacing this older code?
I did see this
The bootstrapping code for all of the blocks has changed in version 6 of Enterprise Library. The blocks no longer use Unity to manage the initialization and configuration, and each block now includes its own bootstrapping code. Any calls to the EnterpriseLibraryContainer.Current.GetInstance method to resolve a type from one of the Enterprise Library blocks should be replaced with the block specific bootstrap code.>
Buuuuut I couldn't find any examples particular to GetInstance so maybe I completely understand what it means to replace it with block specific code :x
Solution I ended up using:
Dim factory As DatabaseProviderFactory = New DatabaseFactory
db = factory.Create(ConfigurationManager.ConnectionStrings("SomeDatabaseWeUse").Name)

NAudio, is TwoTone supported?

I inherited this project that used NAudio 1.7.1.16.
In there they use SignalGenerator.Frequency1 and SignalGenerator.Frequency2 to generate a TwoTone sound.
However, the later version 1.7.2 and latest 1.7.3, Frequency1 and Frequency2 and SignalGeneratorType.TwoTone does not exist any more!
So how do I do the TwoTone thing with the latest version of NAudio?
You must have inherited a custom build of NAudio. NAudio's SignalGenerator has never had a TwoTone option. It has been unchanged ever since it was added in 2012.

gecko in vb.net, objectreference needs objectinstance?

I want to implement a Webbrowser in my vb.net (2008)-project, however, I don't like the inbuilt IE.
I also remembered that is was kind of easy to implement a mozilla-tool like the gecko-webbrowser in the past...
It was kinf of more complicated than I remember, as I had to dwnload xulrunner and Skybound.Gecko.dll which both probably have to be included in any publishing of the finished project... I also defined x86 as target CPU and made all the needed steps to use a GeckoWebBrowser within my Application. I also called Skybound.Gecko.Xpcom.Initialize(My.Application.Info.DirectoryPath & "/xulrunner") before compiling it.
However, when I try GeckoWebBrowser1.navigate("http://...") (The element was inserted with this name per designer) the IDE tells me that an objectreference is not set to a objectinstance as if GeckoWebBrowser1 isn't defined yet... but the GeckoWebBrowser1.Created attribute is giving back true.
Does anybody know why it isn't working yet?
I have the same error in my solution. Try to use GeckoFX assembly. I use 15 version dll and error fix.
https://bitbucket.org/geckofx/geckofx-16.0/downloads

Is possible to load a function from *any|some* llvm generated code in iOS (not made by clang)?

If I build a function with LLVM, like
int sum(int a, int b)
{
return a + b;
}
using something like http://www.llvmpy.org/llvmpy-doc/dev/doc/firstexample.html, is possible to use that function from inside iOS? as if was a function made with C/C++/Obj-c?
This is because I wonder if building a languaje on LLVM auto-magically provide the path to support iOS for free (ie: is as hard as embed python or something like that).
If yes, how can be done? (ie: call sum from obj-c)
Yes, it is possible. I have done exactly that on Android. And iOS is similar enough that it should be possible there. As long as you are using Interpreter for executing your LLVM code. Because using JIT is forbidden by Apple Developer agreement.

Equivalent Carbon 32-bit call for using in 64-bit application - GetApplicationEventTarget()

I'm writing a 64-bit Cocoa application. I need to register for global key events. So I wrote this piece of code :
- (void)awakeFromNib
{
EventHotKeyRef gMyHotKeyRef;
EventHotKeyID gMyHotKeyID;
EventTypeSpec eventType;
eventType.eventClass=kEventClassKeyboard;
eventType.eventKind=kEventHotKeyPressed;
eventType.eventClass=kEventClassKeyboard;
eventType.eventKind=kEventHotKeyPressed;
InstallApplicationEventHandler(&MyHotKeyHandler,1,&eventType,NULL,NULL);
gMyHotKeyID.signature='htk1';
gMyHotKeyID.id=1;
RegisterEventHotKey(49, cmdKey+optionKey, gMyHotKeyID,
**GetApplicationEventTarget**(), 0, &gMyHotKeyRef);
}
But since GetApplicationEventTarget() is not supported for 64-bit applications I'm getting errors. If I declare it, then I don't get any errors but the application crashes.
Is there any equivalent method for GetApplicationEventTarget() (defined in Carbon framework) to use in 64-bit applications.
Or is there any way to get the global key events using cocoa calls?
Any help is appreciated.
Thanks,
Dheeraj.
I wrote a Cocoa wrapper for Carbon hot keys (and as far as my testing showed, it works in 64-bit apps), and you can find it on github here: http://github.com/davedelong/DDHotKey
I'm using GetEventDispatcherTarget() for hotkey registration.
I think it is a documentation error when it says that GetApplicationEventTarget is not supported in 64 bits. If you look in CarbonEvents.h (from the 10.6 SDK), you see that the declaration of GetUserFocusEventTarget is bracketed by #if !__LP64__ ... #endif, but just above it, the declaration of GetApplicationEventTarget is not. GetApplicationEventTarget is probably not the cause of the crash. In your code, gMyHotKeyRef and gMyHotKeyID look like they were intended to be global variables, but they're local.
Carbon isn't supported in 64-bit applications. See the answer to this question for information on how to use CGEventTap to do this in a supported way in Cocoa.