A library for a set of own applications
A library for a set of own applications
If you don't intend to ever link with QtGui and run a non-gui application then you don't have to worry about it. It's a bit strange combination anyway.
Maybe I got it wrong but I for example this is exactly my setup when compiling my QTest based test cases that need to be linked with QtGui but internally QTest instantiates a console application.
So you are instantiating a QCoreApplication yourself?
No, I'm using the QTEST_APPLESS_MAIN() macro.
So you don't have any application object - neither console nor non-console. In this case QCoreApplication::startingUp() would be enough.
This is correct! I was nevertheless looking for a more generic way that would also allow me to work if a QCoreApplication would be instantiated explicitly.
Then qobject_cast<QApplication*>(QCoreApplication::inst ance()) works.
doberkofler (21st September 2010)
Bookmarks