diff options
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index d12b93f9e6..f03d33c7b6 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -833,7 +833,7 @@ void QGuiApplicationPrivate::showModalWindow(QWindow *modal) } } - for (QWindow *window : qAsConst(QGuiApplicationPrivate::window_list)) { + for (QWindow *window : std::as_const(QGuiApplicationPrivate::window_list)) { if (needsWindowBlockedEvent(window) && !window->d_func()->blockedByModalWindow) updateBlockedStatus(window); } @@ -845,7 +845,7 @@ void QGuiApplicationPrivate::hideModalWindow(QWindow *window) { self->modalWindowList.removeAll(window); - for (QWindow *window : qAsConst(QGuiApplicationPrivate::window_list)) { + for (QWindow *window : std::as_const(QGuiApplicationPrivate::window_list)) { if (needsWindowBlockedEvent(window) && window->d_func()->blockedByModalWindow) updateBlockedStatus(window); } @@ -867,7 +867,7 @@ bool QGuiApplicationPrivate::isWindowBlocked(QWindow *window, QWindow **blocking return false; } - for (int i = 0; i < modalWindowList.count(); ++i) { + for (int i = 0; i < modalWindowList.size(); ++i) { QWindow *modalWindow = modalWindowList.at(i); // A window is not blocked by another modal window if the two are @@ -1098,7 +1098,7 @@ qreal QGuiApplication::devicePixelRatio() const return QGuiApplicationPrivate::m_maxDevicePixelRatio; QGuiApplicationPrivate::m_maxDevicePixelRatio = 1.0; // make sure we never return 0. - for (QScreen *screen : qAsConst(QGuiApplicationPrivate::screen_list)) + for (QScreen *screen : std::as_const(QGuiApplicationPrivate::screen_list)) QGuiApplicationPrivate::m_maxDevicePixelRatio = qMax(QGuiApplicationPrivate::m_maxDevicePixelRatio, screen->devicePixelRatio()); return QGuiApplicationPrivate::m_maxDevicePixelRatio; @@ -1246,7 +1246,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString qCDebug(lcQpaTheme) << "Adding platform integration's theme names to list of theme names:" << platformIntegrationThemeNames; themeNames += platformIntegrationThemeNames; // 4) Look for a theme plugin. - for (const QString &themeName : qAsConst(themeNames)) { + for (const QString &themeName : std::as_const(themeNames)) { qCDebug(lcQpaTheme) << "Attempting to create platform theme" << themeName << "via QPlatformThemeFactory::create"; QGuiApplicationPrivate::platform_theme = QPlatformThemeFactory::create(themeName, platformPluginPath); if (QGuiApplicationPrivate::platform_theme) { @@ -1258,7 +1258,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString // 5) If no theme plugin was found ask the platform integration to // create a theme if (!QGuiApplicationPrivate::platform_theme) { - for (const QString &themeName : qAsConst(themeNames)) { + for (const QString &themeName : std::as_const(themeNames)) { qCDebug(lcQpaTheme) << "Attempting to create platform theme" << themeName << "via createPlatformTheme"; QGuiApplicationPrivate::platform_theme = QGuiApplicationPrivate::platform_integration->createPlatformTheme(themeName); if (QGuiApplicationPrivate::platform_theme) { @@ -1279,7 +1279,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString // boolean 'foo' or strings: 'foo=bar' if (!platformArguments.isEmpty()) { if (QObject *nativeInterface = QGuiApplicationPrivate::platform_integration->nativeInterface()) { - for (const QString &argument : qAsConst(platformArguments)) { + for (const QString &argument : std::as_const(platformArguments)) { const int equalsPos = argument.indexOf(u'='); const QByteArray name = equalsPos != -1 ? argument.left(equalsPos).toUtf8() : argument.toUtf8(); @@ -1298,7 +1298,7 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString static void init_plugins(const QList<QByteArray> &pluginList) { - for (int i = 0; i < pluginList.count(); ++i) { + for (int i = 0; i < pluginList.size(); ++i) { QByteArray pluginSpec = pluginList.at(i); int colonPos = pluginSpec.indexOf(':'); QObject *plugin; @@ -1676,7 +1676,7 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate() is_app_closing = true; is_app_running = false; - for (int i = 0; i < generic_plugin_list.count(); ++i) + for (int i = 0; i < generic_plugin_list.size(); ++i) delete generic_plugin_list.at(i); generic_plugin_list.clear(); @@ -2629,8 +2629,9 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl { if (e->window.isNull()) return; - if (e->window.data()->d_func()->blockedByModalWindow) { - // a modal window is blocking this window, don't allow close events through + if (e->window.data()->d_func()->blockedByModalWindow && !e->window.data()->d_func()->inClose) { + // a modal window is blocking this window, don't allow close events through, unless they + // originate from a call to QWindow::close. return; } |