diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-08 19:35:22 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-08 20:50:49 -0800 |
commit | 298235eec78541b1051e6bb1411d98ec98dcebf3 (patch) | |
tree | 22d0240f0233f65807d3d2692b483fee2b55a046 /subsurface-mobile-helper.cpp | |
parent | f7981328627666dd0df51c0ac296e2fa7511238f (diff) | |
download | subsurface-298235eec78541b1051e6bb1411d98ec98dcebf3.tar.gz |
QML UI: pass initial screen information to QMLManager
And make sure updates are delivered as they appear.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-mobile-helper.cpp')
-rw-r--r-- | subsurface-mobile-helper.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index f6c669438..788ba3b4d 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -12,6 +12,7 @@ #include "qt-gui.h" #include <QQuickWindow> +#include <QScreen> #include <QQmlApplicationEngine> #include <QQmlContext> #include <QSortFilterProxyModel> @@ -70,6 +71,12 @@ void run_ui() QQuickWindow *qml_window = qobject_cast<QQuickWindow *>(qqWindowObject); qml_window->setIcon(QIcon(":/subsurface-mobile-icon")); qqWindowObject->setProperty("messageText", QVariant("Subsurface-mobile startup")); + qDebug() << "qqwindow devicePixelRatio" << qml_window->devicePixelRatio() << qml_window->screen()->devicePixelRatio(); + QScreen *screen = qml_window->screen(); + QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged); + QMLManager::instance()->screenChanged(screen); + qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch(); + #if !defined(Q_OS_ANDROID) qml_window->setHeight(1200); qml_window->setWidth(800); |