diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-03-13 10:34:18 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-14 10:47:34 +0100 |
commit | fd7b52d268ab3f9cdcdb06a77b715644d2d22ef3 (patch) | |
tree | 239e2768cf7542d571f2275ed9e2bdf42daa9712 | |
parent | 1d276c256fa6f6ad8cc2c2debd5e0567fd1eba14 (diff) |
Make QCoreApplication::startingUp() return false when appropriate.
Currently, QCoreApplication::startingUp() returns true even after
a QCoreApplication has been constructed. This patch makes it return
false after it has been constructed and adds checks to QApplication
and QGuiApplication to ensure that it returns true within the
constructor of these classes.
Task-number: QTBUG-2591
Change-Id: Ie511522d35b5658c20be43dd112eae18c205277f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index ec808424f9..02d4d0376a 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -638,6 +638,8 @@ void QCoreApplication::init() d->processCommandLineArguments(); qt_startup_hook(); + + QCoreApplicationPrivate::is_app_running = true; // No longer starting up. } /*! diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index d0b37b7f1b..d42da6ee79 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -926,6 +926,8 @@ static bool runningUnderDebugger() void QGuiApplicationPrivate::init() { + QCoreApplicationPrivate::is_app_running = false; // Starting up. + bool doGrabUnderDebugger = false; QList<QByteArray> pluginList; // Get command line params diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 4c6d8cfdc7..7f41e5c576 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -588,6 +588,8 @@ extern void qRegisterWidgetsVariant(); */ void QApplicationPrivate::initialize() { + is_app_running = false; // Starting up. + QWidgetPrivate::mapper = new QWidgetMapper; QWidgetPrivate::allWidgets = new QWidgetSet; @@ -601,8 +603,6 @@ void QApplicationPrivate::initialize() qRegisterGuiStateMachine(); #endif - is_app_running = true; // no longer starting up - Q_Q(QApplication); if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0) @@ -629,6 +629,8 @@ void QApplicationPrivate::initialize() if (QApplication::desktopSettingsAware()) if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt(); + + is_app_running = true; // no longer starting up } /***************************************************************************** |