diff options
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 10 | ||||
-rw-r--r-- | mobile-widgets/qmlmanager.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index a834259f7..d24a4579d 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -85,10 +85,10 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false), m_updateSelectedDive(-1), m_selectedDiveTimestamp(0), m_credentialStatus(UNKNOWN), - m_lastDevicePixelRatio(1.0), alreadySaving(false) { m_instance = this; + m_lastDevicePixelRatio = qApp->devicePixelRatio(); connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged); appendTextToLog(getUserAgent()); appendTextToLog(QStringLiteral("build with Qt Version %1, runtime from Qt Version %2").arg(QT_VERSION_STR).arg(qVersion())); @@ -1412,6 +1412,14 @@ qreal QMLManager::lastDevicePixelRatio() return m_lastDevicePixelRatio; } +void QMLManager::setDevicePixelRatio(qreal dpr, QScreen *screen) +{ + if (m_lastDevicePixelRatio != dpr) { + m_lastDevicePixelRatio = dpr; + emit sendScreenChanged(screen); + } +} + void QMLManager::screenChanged(QScreen *screen) { m_lastDevicePixelRatio = screen->devicePixelRatio(); diff --git a/mobile-widgets/qmlmanager.h b/mobile-widgets/qmlmanager.h index 8c5b02fa1..04f4a40dd 100644 --- a/mobile-widgets/qmlmanager.h +++ b/mobile-widgets/qmlmanager.h @@ -154,6 +154,7 @@ public slots: void refreshDiveList(); void screenChanged(QScreen *screen); qreal lastDevicePixelRatio(); + void setDevicePixelRatio(qreal dpr, QScreen *screen); void appendTextToLog(const QString &newText); void quit(); void hasLocationSourceChanged(); |