From 13b2b9f19c3f9ecb41565c5eab07d590071dede6 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 19 Jan 2020 12:25:17 +0100 Subject: core/settings: allow signals to be strongly typed in C++ Register enums to allow them to be used in signal handlers instead of int. Signed-off-by: jan Iversen Signed-off-by: Dirk Hohndel --- core/settings/qPref.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'core/settings/qPref.cpp') 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(); qRegisterMetaType(); qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); + qRegisterMetaType(); } -- cgit v1.2.3-70-g09d2