diff options
Diffstat (limited to 'qt-models/divelocationmodel.h')
-rw-r--r-- | qt-models/divelocationmodel.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/qt-models/divelocationmodel.h b/qt-models/divelocationmodel.h index 8dbc8f3e6..048b2c0a3 100644 --- a/qt-models/divelocationmodel.h +++ b/qt-models/divelocationmodel.h @@ -10,9 +10,6 @@ #define RECENTLY_ADDED_DIVESITE 1 -bool filter_same_gps_cb (QAbstractItemModel *m, int sourceRow, const QModelIndex& parent); - - class LocationInformationModel : public QAbstractTableModel { Q_OBJECT public: @@ -36,6 +33,19 @@ private: QStringList locationNames; }; +// To access only divesites at the given GPS coordinates with the exception of a given dive site +class GPSLocationInformationModel : public QSortFilterProxyModel { +Q_OBJECT +private: + uint32_t ignoreUuid; + degrees_t latitude, longitude; + bool filterAcceptsRow(int sourceRow, const QModelIndex &source_parent) const override; +public: + GPSLocationInformationModel(QObject *parent = nullptr); + void set(uint32_t ignoreUuid, degrees_t latitude, degrees_t longitude); + void setCoordinates(degrees_t latitude, degrees_t longitude); +}; + class GeoReferencingOptionsModel : public QStringListModel { Q_OBJECT public: |