aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/settings/qPref.cpp17
-rw-r--r--tests/testqPrefUnits.cpp2
2 files changed, 19 insertions, 0 deletions
diff --git a/core/settings/qPref.cpp b/core/settings/qPref.cpp
index 640300f96..522a74c6d 100644
--- a/core/settings/qPref.cpp
+++ b/core/settings/qPref.cpp
@@ -49,6 +49,15 @@ void qPref::loadSync(bool doSync)
Q_DECLARE_METATYPE(deco_mode);
Q_DECLARE_METATYPE(def_file_behavior);
Q_DECLARE_METATYPE(taxonomy_category);
+Q_DECLARE_METATYPE(units::DURATION);
+Q_DECLARE_METATYPE(units::LENGTH);
+Q_DECLARE_METATYPE(units::PRESSURE);
+Q_DECLARE_METATYPE(units::TEMPERATURE);
+Q_DECLARE_METATYPE(unit_system_values);
+Q_DECLARE_METATYPE(units::TIME);
+Q_DECLARE_METATYPE(units::VOLUME);
+Q_DECLARE_METATYPE(units::WEIGHT);
+
void qPref::registerQML(QQmlEngine *engine)
{
if (engine) {
@@ -77,4 +86,12 @@ void qPref::registerQML(QQmlEngine *engine)
qRegisterMetaType<deco_mode>();
qRegisterMetaType<def_file_behavior>();
qRegisterMetaType<taxonomy_category>();
+ qRegisterMetaType<units::DURATION>();
+ qRegisterMetaType<units::LENGTH>();
+ qRegisterMetaType<units::PRESSURE>();
+ qRegisterMetaType<units::TEMPERATURE>();
+ qRegisterMetaType<unit_system_values>();
+ qRegisterMetaType<units::TIME>();
+ qRegisterMetaType<units::VOLUME>();
+ qRegisterMetaType<units::WEIGHT>();
}
diff --git a/tests/testqPrefUnits.cpp b/tests/testqPrefUnits.cpp
index b2ead5c9e..c5635732b 100644
--- a/tests/testqPrefUnits.cpp
+++ b/tests/testqPrefUnits.cpp
@@ -3,6 +3,7 @@
#include "core/pref.h"
#include "core/qthelper.h"
+#include "core/settings/qPref.h"
#include "core/settings/qPrefUnit.h"
#include <QTest>
@@ -13,6 +14,7 @@ void TestQPrefUnits::initTestCase()
QCoreApplication::setOrganizationName("Subsurface");
QCoreApplication::setOrganizationDomain("subsurface.hohndel.org");
QCoreApplication::setApplicationName("SubsurfaceTestQPrefUnits");
+ qPref::registerQML(NULL);
}
void TestQPrefUnits::test_struct_get()