diff options
Diffstat (limited to 'src/gui/kernel/qplatformintegration.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 7d1fcd4eeb..199ef0de07 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -291,7 +291,7 @@ QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::Pix platform implementation is responsible for querying the configuriation from the provided native context. - Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could + Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created. \sa QOpenGLContext @@ -482,6 +482,9 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary) } else { QGuiApplicationPrivate::screen_list.append(screen); } + + QGuiApplicationPrivate::resetCachedDevicePixelRatio(); + emit qGuiApp->screenAdded(screen); if (isPrimary) @@ -499,6 +502,8 @@ void QPlatformIntegration::removeScreen(QScreen *screen) const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen); QGuiApplicationPrivate::screen_list.removeOne(screen); + QGuiApplicationPrivate::resetCachedDevicePixelRatio(); + if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty()) emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0)); } @@ -534,7 +539,7 @@ void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary) if (idx == 0) return; - QGuiApplicationPrivate::screen_list.swap(0, idx); + QGuiApplicationPrivate::screen_list.swapItemsAt(0, idx); emit qGuiApp->primaryScreenChanged(newPrimaryScreen); } @@ -642,7 +647,7 @@ void QPlatformIntegration::setApplicationIcon(const QIcon &icon) const pointer to the instance for which a platform-specific backend needs to be created. - Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could + Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created. \sa QVulkanInstance |