diff options
author | jan Iversen <jan@casacondor.com> | 2020-01-19 12:25:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-01-20 09:49:49 -0800 |
commit | 13b2b9f19c3f9ecb41565c5eab07d590071dede6 (patch) | |
tree | f937ac09e6862b2dceec2b12cb25e8b9e8764054 /core | |
parent | 75fe59b0da4d15c2e63c070f6f561805af86e5d9 (diff) | |
download | subsurface-13b2b9f19c3f9ecb41565c5eab07d590071dede6.tar.gz |
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 <jan@casacondor.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/settings/qPref.cpp | 17 |
1 files changed, 17 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>(); } |