mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Set up model for GPS fixes
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2b1ffb3cc4
commit
8a98dd485a
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
#include "qt-mobile/qmlmanager.h"
|
#include "qt-mobile/qmlmanager.h"
|
||||||
#include "qt-models/divelistmodel.h"
|
#include "qt-models/divelistmodel.h"
|
||||||
|
#include "qt-models/gpslistmodel.h"
|
||||||
#include "qt-mobile/qmlprofile.h"
|
#include "qt-mobile/qmlprofile.h"
|
||||||
|
|
||||||
QObject *qqWindowObject = NULL;
|
QObject *qqWindowObject = NULL;
|
||||||
|
@ -51,8 +52,15 @@ void run_ui()
|
||||||
sortModel->setDynamicSortFilter(true);
|
sortModel->setDynamicSortFilter(true);
|
||||||
sortModel->setSortRole(DiveListModel::DiveDateRole);
|
sortModel->setSortRole(DiveListModel::DiveDateRole);
|
||||||
sortModel->sort(0, Qt::DescendingOrder);
|
sortModel->sort(0, Qt::DescendingOrder);
|
||||||
|
GpsListModel gpsListModel;
|
||||||
|
QSortFilterProxyModel *gpsSortModel = new QSortFilterProxyModel(0);
|
||||||
|
gpsSortModel->setSourceModel(&gpsListModel);
|
||||||
|
gpsSortModel->setDynamicSortFilter(true);
|
||||||
|
gpsSortModel->setSortRole(GpsListModel::GpsDateRole);
|
||||||
|
gpsSortModel->sort(0, Qt::DescendingOrder);
|
||||||
QQmlContext *ctxt = engine.rootContext();
|
QQmlContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("diveModel", sortModel);
|
ctxt->setContextProperty("diveModel", sortModel);
|
||||||
|
ctxt->setContextProperty("gpsModel", gpsSortModel);
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
||||||
qqWindowObject = engine.rootObjects().value(0);
|
qqWindowObject = engine.rootObjects().value(0);
|
||||||
if (!qqWindowObject) {
|
if (!qqWindowObject) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue