diff options
-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); |