mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
8c7d1a1163
commit
be0d513324
3 changed files with 13 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue