summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlinterface.cpp
diff options
context:
space:
mode:
authorGravatar jan Iversen <jan@casacondor.com>2020-01-18 23:12:32 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-01-20 09:49:05 -0800
commit25a5be0fe901910c632cd422e4fa556b2c4c83ec (patch)
tree72ff68403f8646254b6321111b9a8812deb0052a /mobile-widgets/qmlinterface.cpp
parent52b390d32a5239d41ed8c1b0e1f5e9211d9c8588 (diff)
downloadsubsurface-25a5be0fe901910c632cd422e4fa556b2c4c83ec.tar.gz
mobile-widgets: allow qPrefUnit strongly typed in QML
Add qPrefUnit Q_PROPERTY but using QMLInterface enums, that way all variables become strongly typed in QML. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlinterface.cpp')
-rw-r--r--mobile-widgets/qmlinterface.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp
index 2f470bba4..e4f2dd6e5 100644
--- a/mobile-widgets/qmlinterface.cpp
+++ b/mobile-widgets/qmlinterface.cpp
@@ -20,4 +20,20 @@ void QMLInterface::setup(QQmlContext *ct)
// relink signals to QML
connect(qPrefCloudStorage::instance(), &qPrefCloudStorage::cloud_verification_statusChanged,
[=] (int value) { emit instance()->cloud_verification_statusChanged(CLOUD_STATUS(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::duration_unitsChanged,
+ [=] (int value) { emit instance()->duration_unitsChanged(DURATION(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::lengthChanged,
+ [=] (int value) { emit instance()->lengthChanged(LENGTH(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::pressureChanged,
+ [=] (int value) { emit instance()->pressureChanged(PRESSURE(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::temperatureChanged,
+ [=] (int value) { emit instance()->temperatureChanged(TEMPERATURE(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::unit_systemChanged,
+ [=] (int value) { emit instance()->unit_systemChanged(UNIT_SYSTEM(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::vertical_speed_timeChanged,
+ [=] (int value) { emit instance()->vertical_speed_timeChanged(TIME(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::volumeChanged,
+ [=] (int value) { emit instance()->volumeChanged(VOLUME(value)); });
+ connect(qPrefUnits::instance(), &qPrefUnits::weightChanged,
+ [=] (int value) { emit instance()->weightChanged(WEIGHT(value)); });
}