mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
f798132862
commit
298235eec7
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue