Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.4.1
-
None
-
fd7b52d268ab3f9cdcdb06a77b715644d2d22ef3 9181ee4d86b29b12d2c87fda0699c10df4b28e43
Description
The following prints true even after the QCoreApplication instance has been created. It only returns false after QApplication has been created.
#include <QtGui> int main(int argc, char** argv) { qDebug() << "Before QCoreApp c'tor" << QCoreApplication::startingUp(); { QCoreApplication coreapp(argc, argv); qDebug() << "After QCoreApp c'tor" << QCoreApplication::startingUp(); } qDebug() << "After QCoreApp d'tor" << QCoreApplication::startingUp(); { QApplication app(argc, argv); qDebug() << "After QApp c'tor" << QCoreApplication::startingUp(); } qDebug() << "After QApp d'tor" << QCoreApplication::startingUp(); return 0; }
closingDown correctly returns true after either d'tor call, and false after the c'tor. The is_app_running variable is never changed by QCoreApplication or QCoreApplicationPrivate - only by QApplicationPrivate.
Attachments
For Gerrit Dashboard: QTBUG-2591 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
50839,1 | Make QCoreApplication::startingUp() return false when appropriate. | stable | qt/qtbase | Status: MERGED | +2 | 0 |