diff options
author | Steve Mokris <smokris@softpixel.com> | 2018-12-08 12:28:02 -0500 |
---|---|---|
committer | Steve Mokris <smokris@softpixel.com> | 2018-12-10 01:45:29 +0000 |
commit | ba304af284f4cbb579d35046c0cf4c1537af0fec (patch) | |
tree | 4395e4941fb55333b37dd5417797d911925f88d1 /src/gui/kernel/qplatformintegration.cpp | |
parent | b2297e595c43a5986a082c40443576436f8497d0 (diff) |
Refresh QGuiApplication's devicePixelRatio cache when screens change
Task-number: QTBUG-63548
Change-Id: Id934cda6e15449c00c80a646055899f49580da88
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformintegration.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 9836f569fc..bff1c907d6 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -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)); } |