diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-04-03 17:29:06 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-04 11:00:18 -0700 |
commit | 01d091fbd5ff88ac530f26c36b2cba3cc936448b (patch) | |
tree | 640207dbd88d285f78dcb7b6a04f8ab583d3cc83 /subsurface-mobile-helper.cpp | |
parent | e700ea9638907c63a2cc032e005da9352341bd1c (diff) | |
download | subsurface-01d091fbd5ff88ac530f26c36b2cba3cc936448b.tar.gz |
QML UI: better handling of device pixel ratio
In order to make sure we don't render the initial profiles with the
wrong scale on devices, we need to seed the device pixel ratio with the
device default and then update it once the window has been created.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r-- | subsurface-mobile-helper.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index 05155b3b4..8263f96c5 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -79,6 +79,7 @@ void run_ui() QScreen *screen = qml_window->screen(); QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged); QMLManager *manager = QMLManager::instance(); + manager->setDevicePixelRatio(qml_window->devicePixelRatio(), qml_window->screen()); manager->dlSortModel = sortModel; manager->screenChanged(screen); qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch(); |