mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
a71afd31ee
commit
d0edc29636
9 changed files with 62 additions and 59 deletions
|
@ -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); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue