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>
This commit is contained in:
parent
1d276c256f
commit
fd7b52d268
@ -638,6 +638,8 @@ void QCoreApplication::init()
|
|||||||
d->processCommandLineArguments();
|
d->processCommandLineArguments();
|
||||||
|
|
||||||
qt_startup_hook();
|
qt_startup_hook();
|
||||||
|
|
||||||
|
QCoreApplicationPrivate::is_app_running = true; // No longer starting up.
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -926,6 +926,8 @@ static bool runningUnderDebugger()
|
|||||||
|
|
||||||
void QGuiApplicationPrivate::init()
|
void QGuiApplicationPrivate::init()
|
||||||
{
|
{
|
||||||
|
QCoreApplicationPrivate::is_app_running = false; // Starting up.
|
||||||
|
|
||||||
bool doGrabUnderDebugger = false;
|
bool doGrabUnderDebugger = false;
|
||||||
QList<QByteArray> pluginList;
|
QList<QByteArray> pluginList;
|
||||||
// Get command line params
|
// Get command line params
|
||||||
|
@ -588,6 +588,8 @@ extern void qRegisterWidgetsVariant();
|
|||||||
*/
|
*/
|
||||||
void QApplicationPrivate::initialize()
|
void QApplicationPrivate::initialize()
|
||||||
{
|
{
|
||||||
|
is_app_running = false; // Starting up.
|
||||||
|
|
||||||
QWidgetPrivate::mapper = new QWidgetMapper;
|
QWidgetPrivate::mapper = new QWidgetMapper;
|
||||||
QWidgetPrivate::allWidgets = new QWidgetSet;
|
QWidgetPrivate::allWidgets = new QWidgetSet;
|
||||||
|
|
||||||
@ -601,8 +603,6 @@ void QApplicationPrivate::initialize()
|
|||||||
qRegisterGuiStateMachine();
|
qRegisterGuiStateMachine();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
is_app_running = true; // no longer starting up
|
|
||||||
|
|
||||||
Q_Q(QApplication);
|
Q_Q(QApplication);
|
||||||
|
|
||||||
if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0)
|
if (qgetenv("QT_USE_NATIVE_WINDOWS").toInt() > 0)
|
||||||
@ -629,6 +629,8 @@ void QApplicationPrivate::initialize()
|
|||||||
if (QApplication::desktopSettingsAware())
|
if (QApplication::desktopSettingsAware())
|
||||||
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
|
if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
|
||||||
QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt();
|
QApplicationPrivate::enabledAnimations = theme->themeHint(QPlatformTheme::UiEffects).toInt();
|
||||||
|
|
||||||
|
is_app_running = true; // no longer starting up
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user