From 298235eec78541b1051e6bb1411d98ec98dcebf3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 8 Mar 2016 19:35:22 -0800 Subject: QML UI: pass initial screen information to QMLManager And make sure updates are delivered as they appear. Signed-off-by: Dirk Hohndel --- subsurface-mobile-helper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'subsurface-mobile-helper.cpp') 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 +#include #include #include #include @@ -70,6 +71,12 @@ void run_ui() QQuickWindow *qml_window = qobject_cast(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); -- cgit v1.2.3-70-g09d2