summaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.cpp
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-27 22:43:10 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commit2dea6f514696ea8e740c9028b7426f958bfb2c96 (patch)
tree112f902e33c8d1e4e8fdd171380dd8136bad3219 /qt-models/maplocationmodel.cpp
parentf7095aa89e9d27e006a6d75564ba5b9fa63554a5 (diff)
downloadsubsurface-2dea6f514696ea8e740c9028b7426f958bfb2c96.tar.gz
maplocation: add helpers for coordinate and uuid
getRole() returns a QVariant and the cast is a small overhead. Using these helpers will reduce the overhead. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-models/maplocationmodel.cpp')
-rw-r--r--qt-models/maplocationmodel.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/qt-models/maplocationmodel.cpp b/qt-models/maplocationmodel.cpp
index 8ce5e3020..152688367 100644
--- a/qt-models/maplocationmodel.cpp
+++ b/qt-models/maplocationmodel.cpp
@@ -28,6 +28,22 @@ QVariant MapLocation::getRole(int role) const
}
}
+QGeoCoordinate MapLocation::coordinate()
+{
+ return m_coordinate;
+}
+
+void MapLocation::setCoordinate(QGeoCoordinate coord)
+{
+ m_coordinate = coord;
+ emit coordinateChanged();
+}
+
+quint32 MapLocation::uuid()
+{
+ return m_uuid;
+}
+
MapLocationModel::MapLocationModel(QObject *parent) : QAbstractListModel(parent)
{
m_roles[MapLocation::Roles::RoleUuid] = MapLocation::PROPERTY_NAME_UUID;