diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-24 17:00:06 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 5ea702199bba685e78c9592b4016dc3afed12833 (patch) | |
tree | d6d968e0e791f0504ccaaf559a03f7db36f30bf7 /qt-models/maplocationmodel.h | |
parent | 747f3d8cab5c9021a2f3f142e06ee3beaef164e8 (diff) | |
download | subsurface-5ea702199bba685e78c9592b4016dc3afed12833.tar.gz |
maplocationmodel: make setSelectedUuid() accept "fromClick" flag
The idea of this flag is to be able to only to emit the
selectedLocationChanged() signal when the user clicked on the map
(fromClick == true).
MapWidgetHelper::selectedLocationChanged() listens for this signal
and only then it will select nearby dives based on a "small-cicle".
If "fromClick" is false, it's the backend or the dive list that
updated the selection and MapWidgetHelper::selectedLocationChanged()
should no be called.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-models/maplocationmodel.h')
-rw-r--r-- | qt-models/maplocationmodel.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h index ea720b983..e17c0ede8 100644 --- a/qt-models/maplocationmodel.h +++ b/qt-models/maplocationmodel.h @@ -38,7 +38,7 @@ class MapLocationModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ count NOTIFY countChanged) - Q_PROPERTY(quint32 selectedUuid READ selectedUuid WRITE setSelectedUuid NOTIFY selectedLocationChanged) + Q_PROPERTY(quint32 selectedUuid MEMBER m_selectedUuid NOTIFY selectedLocationChanged) public: MapLocationModel(QObject *parent = NULL); @@ -57,9 +57,8 @@ public: protected: QHash<int, QByteArray> roleNames() const; -private: - quint32 selectedUuid(); - void setSelectedUuid(quint32); +public: + Q_INVOKABLE void setSelectedUuid(QVariant uuid, QVariant fromClick = true); QVector<MapLocation *> m_mapLocations; QHash<int, QByteArray> m_roles; |