From 0c23e005ea421af415e124fff29c24a908b51ea3 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 8 Dec 2019 20:26:45 +0100 Subject: startup mobile: make diveplanner part of Qt type system Register DivePlanner before starting QML. Signed-off-by: Jan Iversen --- subsurface-helper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'subsurface-helper.cpp') diff --git a/subsurface-helper.cpp b/subsurface-helper.cpp index d1c24c4cd..a19c52a2f 100644 --- a/subsurface-helper.cpp +++ b/subsurface-helper.cpp @@ -20,6 +20,7 @@ #include "qt-models/messagehandlermodel.h" #include "profile-widget/qmlprofile.h" #include "core/downloadfromdcthread.h" +#include "core/plannershared.h" #include "qt-models/diveimportedmodel.h" #include "mobile-widgets/qml/kirigami/src/kirigamiplugin.h" #else @@ -183,6 +184,13 @@ void register_qml_types(QQmlEngine *engine) int rc; #ifdef SUBSURFACE_MOBILE + // register shared diveplanner class + if (engine != NULL) { + QQmlContext *ct = engine->rootContext(); + + ct->setContextProperty("Planner", plannerShared::instance()); + } + REGISTER_TYPE(QMLManager, "QMLManager"); REGISTER_TYPE(QMLPrefs, "QMLPrefs"); REGISTER_TYPE(QMLProfile, "QMLProfile"); -- cgit v1.2.3-70-g09d2