mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-20 06:45:27 +00:00
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>
This commit is contained in:
parent
ccaaff42a3
commit
f5882362d3
2 changed files with 27 additions and 0 deletions
11
mobile-widgets/qmlmapwidgethelper.cpp
Normal file
11
mobile-widgets/qmlmapwidgethelper.cpp
Normal file
|
@ -0,0 +1,11 @@
|
|||
#include <QDebug>
|
||||
#include "qmlmapwidgethelper.h"
|
||||
|
||||
MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void MapWidgetHelper::test()
|
||||
{
|
||||
qDebug() << "test";
|
||||
}
|
16
mobile-widgets/qmlmapwidgethelper.h
Normal file
16
mobile-widgets/qmlmapwidgethelper.h
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue