summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qguiapplication_p.h
diff options
context:
space:
mode:
authorSteve Mokris <smokris@softpixel.com>2018-12-08 12:28:02 -0500
committerSteve Mokris <smokris@softpixel.com>2018-12-10 01:45:29 +0000
commitba304af284f4cbb579d35046c0cf4c1537af0fec (patch)
tree4395e4941fb55333b37dd5417797d911925f88d1 /src/gui/kernel/qguiapplication_p.h
parentb2297e595c43a5986a082c40443576436f8497d0 (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/qguiapplication_p.h')
-rw-r--r--src/gui/kernel/qguiapplication_p.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h
index 79c1a1c820..a5f3f99a31 100644
--- a/src/gui/kernel/qguiapplication_p.h
+++ b/src/gui/kernel/qguiapplication_p.h
@@ -311,6 +311,8 @@ public:
static void setApplicationState(Qt::ApplicationState state, bool forcePropagate = false);
+ static void resetCachedDevicePixelRatio();
+
protected:
virtual void notifyThemeChanged();
bool tryCloseRemainingWindows(QWindowList processedWindows);
@@ -330,6 +332,10 @@ private:
bool ownGlobalShareContext;
static QInputDeviceManager *m_inputDeviceManager;
+
+ // Cache the maximum device pixel ratio, to iterate through the screen list
+ // only the first time it's required, or when devices are added or removed.
+ static qreal m_maxDevicePixelRatio;
};
Q_GUI_EXPORT uint qHash(const QGuiApplicationPrivate::ActiveTouchPointsKey &k);