From 8a98dd485a80790cd80be9332230675b42c8051c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 7 Jan 2016 21:36:27 -0800 Subject: Set up model for GPS fixes Signed-off-by: Dirk Hohndel --- subsurface-mobile-helper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'subsurface-mobile-helper.cpp') diff --git a/subsurface-mobile-helper.cpp b/subsurface-mobile-helper.cpp index 9d9875ead..4956a112d 100644 --- a/subsurface-mobile-helper.cpp +++ b/subsurface-mobile-helper.cpp @@ -17,6 +17,7 @@ #include #include "qt-mobile/qmlmanager.h" #include "qt-models/divelistmodel.h" +#include "qt-models/gpslistmodel.h" #include "qt-mobile/qmlprofile.h" QObject *qqWindowObject = NULL; @@ -51,8 +52,15 @@ void run_ui() sortModel->setDynamicSortFilter(true); sortModel->setSortRole(DiveListModel::DiveDateRole); 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(); ctxt->setContextProperty("diveModel", sortModel); + ctxt->setContextProperty("gpsModel", gpsSortModel); engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml"))); qqWindowObject = engine.rootObjects().value(0); if (!qqWindowObject) { -- cgit v1.2.3-70-g09d2