aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qmlinterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets/qmlinterface.cpp')
-rw-r--r--mobile-widgets/qmlinterface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/mobile-widgets/qmlinterface.cpp b/mobile-widgets/qmlinterface.cpp
new file mode 100644
index 000000000..78aba6a5c
--- /dev/null
+++ b/mobile-widgets/qmlinterface.cpp
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "qmlinterface.h"
+
+#include <QQmlEngine>
+
+QMLInterface *QMLInterface::instance()
+{
+ static QMLInterface *self = new QMLInterface;
+ return self;
+}
+
+void QMLInterface::setup(QQmlContext *ct)
+{
+ // Register interface class
+ ct->setContextProperty("Backend", QMLInterface::instance());
+
+ // Make enums available as types
+ qmlRegisterUncreatableType<QMLInterface>("org.subsurfacedivelog.mobile",1,0,"Enums","Enum is not a type");
+
+ // relink signals to QML
+}