mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make it easy to access the sort model from the QML manager
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2878236268
commit
5909e438c9
2 changed files with 5 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
#include "core/gpslocation.h"
|
#include "core/gpslocation.h"
|
||||||
|
#include "qt-models/divelistmodel.h"
|
||||||
|
|
||||||
class QMLManager : public QObject {
|
class QMLManager : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -81,6 +82,7 @@ public:
|
||||||
void setSyncToCloud(bool status);
|
void setSyncToCloud(bool status);
|
||||||
|
|
||||||
typedef void (QMLManager::*execute_function_type)();
|
typedef void (QMLManager::*execute_function_type)();
|
||||||
|
DiveListSortModel *dlSortModel;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void applicationStateChanged(Qt::ApplicationState state);
|
void applicationStateChanged(Qt::ApplicationState state);
|
||||||
|
|
|
@ -74,7 +74,9 @@ void run_ui()
|
||||||
qDebug() << "qqwindow devicePixelRatio" << qml_window->devicePixelRatio() << qml_window->screen()->devicePixelRatio();
|
qDebug() << "qqwindow devicePixelRatio" << qml_window->devicePixelRatio() << qml_window->screen()->devicePixelRatio();
|
||||||
QScreen *screen = qml_window->screen();
|
QScreen *screen = qml_window->screen();
|
||||||
QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged);
|
QObject::connect(qml_window, &QQuickWindow::screenChanged, QMLManager::instance(), &QMLManager::screenChanged);
|
||||||
QMLManager::instance()->screenChanged(screen);
|
QMLManager *manager = QMLManager::instance();
|
||||||
|
manager->dlSortModel = sortModel;
|
||||||
|
manager->screenChanged(screen);
|
||||||
qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch();
|
qDebug() << "qqwindow screen has ldpi/pdpi" << screen->logicalDotsPerInch() << screen->physicalDotsPerInch();
|
||||||
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
#if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS)
|
||||||
qml_window->setHeight(1200);
|
qml_window->setHeight(1200);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue