summaryrefslogtreecommitdiffstats
path: root/core/settings/qPref.h
diff options
context:
space:
mode:
authorGravatar jan Iversen <jani@apache.org>2018-09-04 11:18:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-09-11 17:22:58 -0700
commitd0edc296360e7653a4c8b672cfb136581c4a10f0 (patch)
tree6d42fcee2174770cd1e0c8edd892540553ee40b6 /core/settings/qPref.h
parenta71afd31ee66edf45c8970dcbd6514d7c4b5e9f0 (diff)
downloadsubsurface-d0edc296360e7653a4c8b672cfb136581c4a10f0.tar.gz
core,tests: change qml register function
In order to address the C++ object directy in qml, a different registration is needed. qmlRegisterType, registers the C++ class, allowing qml code to inherit from it and make qml objects. This is needed for graphical elemnets like profile and map setContentProperty, registers the C++ object, thus allowing signals to be catched. Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'core/settings/qPref.h')
-rw-r--r--core/settings/qPref.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/settings/qPref.h b/core/settings/qPref.h
index f62a5eec4..e42e2b96b 100644
--- a/core/settings/qPref.h
+++ b/core/settings/qPref.h
@@ -5,6 +5,7 @@
#include "ssrf-version.h"
#include <QObject>
+#include <QQmlEngine>
#include "qPrefCloudStorage.h"
#include "qPrefDisplay.h"
@@ -23,7 +24,6 @@
class qPref : public QObject {
Q_OBJECT
- Q_ENUMS(cloud_status);
Q_PROPERTY(QString canonical_version READ canonical_version);
Q_PROPERTY(QString mobile_version READ mobile_version);
@@ -36,7 +36,7 @@ public:
static void sync() { loadSync(true); }
// Register QML
- void registerQML();
+ void registerQML(QQmlEngine *engine);
public:
enum cloud_status {
@@ -46,6 +46,7 @@ public:
CS_VERIFIED,
CS_NOCLOUD
};
+ Q_ENUM(cloud_status);
static const QString canonical_version() { return QString(CANONICAL_VERSION_STRING); }
static const QString mobile_version() { return QString(MOBILE_VERSION_STRING); }