summaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-25 23:15:28 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitbe0d5133240f6113cced1df43b5a5f58c3eff6ed (patch)
tree99fab047a72ce753761ff2d97afbc7a68378b3ec /qt-models/maplocationmodel.h
parent8c7d1a1163ba22cd1b5e75b723affacc9d0cfd1c (diff)
downloadsubsurface-be0d5133240f6113cced1df43b5a5f58c3eff6ed.tar.gz
maplocationmodel: add the "namer" property
The MapLocation QObject now has a QString property "name", which is translating the dive_site->name member. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-models/maplocationmodel.h')
-rw-r--r--qt-models/maplocationmodel.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h
index ba93da8f9..9076de21d 100644
--- a/qt-models/maplocationmodel.h
+++ b/qt-models/maplocationmodel.h
@@ -14,24 +14,28 @@ class MapLocation : public QObject
Q_OBJECT
Q_PROPERTY(quint32 uuid MEMBER m_uuid)
Q_PROPERTY(QGeoCoordinate coordinate MEMBER m_coordinate)
+ Q_PROPERTY(QString name MEMBER m_name)
public:
static const char *PROPERTY_NAME_COORDINATE;
static const char *PROPERTY_NAME_UUID;
+ static const char *PROPERTY_NAME_NAME;
explicit MapLocation();
- explicit MapLocation(quint32 uuid, QGeoCoordinate coord);
+ explicit MapLocation(quint32 uuid, QGeoCoordinate coord, QString name);
QVariant getRole(int role) const;
enum Roles {
RoleUuid = Qt::UserRole + 1,
- RoleCoordinate
+ RoleCoordinate,
+ RoleName
};
private:
quint32 m_uuid;
QGeoCoordinate m_coordinate;
+ QString m_name;
};
class MapLocationModel : public QAbstractListModel