subsurface/mobile-widgets/qmlmapwidgethelper.h
Lubomir I. Ivanov a50e9866d5 qmlmapwidgethelper: maintain an instance of MapLocationModel
The idea here is that the QML code should be able to fetch a model
from the MapWidgetHelper instance which is instantiated inside the
QML code; fetch it in the lines of "mapHelper.model".

This way, updates at the backend would be reflected on the Map QML widget.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-07-28 07:31:11 -07:00

29 lines
575 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef QMLMAPWIDGETHELPER_H
#define QMLMAPWIDGETHELPER_H
#include <QObject>
class MapLocationModel;
struct dive_site;
class MapWidgetHelper : public QObject {
Q_OBJECT
Q_PROPERTY(QObject *map MEMBER m_map)
Q_PROPERTY(MapLocationModel *model MEMBER m_mapLocationModel NOTIFY modelChanged)
public:
explicit MapWidgetHelper(QObject *parent = NULL);
void centerOnDiveSite(struct dive_site *);
private:
QObject *m_map;
MapLocationModel *m_mapLocationModel;
signals:
void modelChanged();
};
#endif