summaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-08 19:31:05 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-08 20:50:42 -0800
commit7f99d9e9c3d8fbfd4178ed57ee792832b6a81f51 (patch)
tree6a8791795d638f806f05cead1fc329a4d803f6b5 /qt-mobile/qmlmanager.cpp
parent308b69359d0c591d3b98caaaae21de9e672b4a9a (diff)
downloadsubsurface-7f99d9e9c3d8fbfd4178ed57ee792832b6a81f51.tar.gz
QMLManager: helper function for devivePixelRatio
This allows us to use the single manager object to keep track of the dpr of the screen and to pass it on if it changes (or when it first becomes known). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 9d506859d..f0e6dcca4 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -954,3 +954,14 @@ void QMLManager::setAccessingCloud(bool status)
m_accessingCloud = status;
emit accessingCloudChanged();
}
+
+qreal QMLManager::lastDevicePixelRatio()
+{
+ return m_lastDevicePixelRatio;
+}
+
+void QMLManager::screenChanged(QScreen *screen)
+{
+ m_lastDevicePixelRatio = screen->devicePixelRatio();
+ emit sendScreenChanged(screen);
+}