diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-08 19:31:05 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-08 20:50:42 -0800 |
commit | 7f99d9e9c3d8fbfd4178ed57ee792832b6a81f51 (patch) | |
tree | 6a8791795d638f806f05cead1fc329a4d803f6b5 /qt-mobile/qmlmanager.cpp | |
parent | 308b69359d0c591d3b98caaaae21de9e672b4a9a (diff) | |
download | subsurface-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.cpp | 11 |
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); +} |