mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-29 05:30:41 +00:00
3624d30354
This method uses the helper printGPSCoords() to format the coordinates of a location into either decimal or sexagesimal. The selection is handled by the boolean flag "formatTraditional" and the user preferences flag - prefs.coordinates_traditional. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
38 lines
865 B
C++
38 lines
865 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
#ifndef QMLMAPWIDGETHELPER_H
|
|
#define QMLMAPWIDGETHELPER_H
|
|
|
|
#include <QObject>
|
|
|
|
class QGeoCoordinate;
|
|
class MapLocationModel;
|
|
class MapLocation;
|
|
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 *);
|
|
void reloadMapLocations();
|
|
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
|
|
|
|
private:
|
|
QObject *m_map;
|
|
MapLocationModel *m_mapLocationModel;
|
|
|
|
private slots:
|
|
void selectedLocationChanged(MapLocation *);
|
|
|
|
signals:
|
|
void modelChanged();
|
|
};
|
|
|
|
extern "C" const char *printGPSCoords(int lat, int lon);
|
|
|
|
#endif
|