aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-16 02:51:08 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitf5882362d3a8a6de03208c6aa899d075a3b17f28 (patch)
treef8f8ad96bf555b178939e2d01984d52378627057
parentccaaff42a39d65328e43c812ec4b2d0d68a651bd (diff)
downloadsubsurface-f5882362d3a8a6de03208c6aa899d075a3b17f28.tar.gz
mobile-widgets: add the helper class MapWidgetHelper
The idea with this class is that it should be used by both the mobile and desktop version. TODO STEPS: 1) the class should be registered in both the mobile and desktop version with qmlRegisterType<MapWidgetHelper>... 2) the MapWidget.qml should create an instance of this class. 3) this way the helper will be part of the QML and both the desktop and mobile version can have access to it. 4) the desktop version as a first implementation can just use findChild() in desktop-widgets/mapwidget.cpp. 5) desktop-widgets/mapwidget.cpp on the desktop should just translate calls from the rest of the desktop-widgets to this helper class. 6) the mobile version access to this object would be easy but is off the scope for now. 7) the idea, when implementing the desktop support is to make it so that when implementing the mobile version later, no or only minimal changes would be required to the MapWidgetHelper class. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
-rw-r--r--mobile-widgets/qmlmapwidgethelper.cpp11
-rw-r--r--mobile-widgets/qmlmapwidgethelper.h16
2 files changed, 27 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.cpp b/mobile-widgets/qmlmapwidgethelper.cpp
new file mode 100644
index 000000000..c5258b739
--- /dev/null
+++ b/mobile-widgets/qmlmapwidgethelper.cpp
@@ -0,0 +1,11 @@
+#include <QDebug>
+#include "qmlmapwidgethelper.h"
+
+MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
+{
+}
+
+void MapWidgetHelper::test()
+{
+ qDebug() << "test";
+}
diff --git a/mobile-widgets/qmlmapwidgethelper.h b/mobile-widgets/qmlmapwidgethelper.h
new file mode 100644
index 000000000..c7e532c3c
--- /dev/null
+++ b/mobile-widgets/qmlmapwidgethelper.h
@@ -0,0 +1,16 @@
+#ifndef QMLMAPWIDGETHELPER_H
+#define QMLMAPWIDGETHELPER_H
+
+#include <QObject>
+
+class MapWidgetHelper : public QObject {
+
+ Q_OBJECT
+
+public:
+ explicit MapWidgetHelper(QObject *parent = NULL);
+
+ void test();
+};
+
+#endif