From fdc2fd35bf3a24f64b3f86a1caa4d69257c9dfab Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sat, 4 Jan 2020 09:26:09 +0100 Subject: mobile-widgets: add pure interface for passing values to QML Add a header file that contains a duplicate of the enums, that are needed in QML in one class. the unit enums are added imidiatly, since they are needed or will be neede shortly in Settings and DivePlannerSettings This class will also contain Q_PROPERTY and signal/slot for variables used in QML. This is done to allow e.g. deco_mode qPrefUnits::planner_deco_mode() void qPrefUnits::set_planner_deco_mode(deco_mode) as strongly typed in C++ and DECO_MODE planner_deco_mode() void set_planner_deco_mode(DECO_MODE) as strongly typed in QML Remark: wrong assignments gives errors in QML The advantage over using strings or the value directly is that QML detects typos and flags them as errors/warnings. It is important to note that the class may only contain a) a function call to the implementation b) a reference to a global variable e.g. prefs. Added note to the original definitions of the enums that they have been duplicated. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- packaging/ios/Subsurface-mobile.pro | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packaging/ios') diff --git a/packaging/ios/Subsurface-mobile.pro b/packaging/ios/Subsurface-mobile.pro index 4b8aa079c..afe2e10c5 100644 --- a/packaging/ios/Subsurface-mobile.pro +++ b/packaging/ios/Subsurface-mobile.pro @@ -110,6 +110,7 @@ SOURCES += ../../subsurface-mobile-main.cpp \ ../../core/subsurface-qt/DiveListNotifier.cpp \ ../../backend-shared/exportfuncs.cpp \ ../../backend-shared/plannershared.cpp \ + ../../mobile-widgets/qmlinterface.cpp \ ../../mobile-widgets/qmlmanager.cpp \ ../../qt-models/divelistmodel.cpp \ ../../qt-models/diveplotdatamodel.cpp \ @@ -242,6 +243,7 @@ HEADERS += \ ../../core/subsurface-qt/DiveListNotifier.h \ ../../backend-shared/exportfuncs.h \ ../../backend-shared/plannershared.h \ + ../../mobile-widgets/qmlinterface.h \ ../../mobile-widgets/qmlmanager.h \ ../../map-widget/qmlmapwidgethelper.h \ ../../qt-models/divelistmodel.h \ -- cgit v1.2.3-70-g09d2