summaryrefslogtreecommitdiffstats
path: root/qt-models/maplocationmodel.h
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-07-17 22:12:04 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-07-28 07:31:11 -0700
commitf4e6df475e1cfd93dc0d73287ec6a5113b5eb176 (patch)
treeacea1a7ddba7810b4c7cf2b718832c7bacce907a /qt-models/maplocationmodel.h
parent52316229cdd57a7c11092bc0522f0b67192aead7 (diff)
downloadsubsurface-f4e6df475e1cfd93dc0d73287ec6a5113b5eb176.tar.gz
maplocationmodel: implement the clear() and add() methods
- add() will be used to add a MapLocation to the model with beginInsertRows()...endInsertRows() - clear() will be used to clear the model with beginRemoveRows()... endRemoveRows() NOTE: emiting dataChanged() does not seem to update the QML view for this model so calling being<..>Rows() seems to be the "correct Qt approach" to do this. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'qt-models/maplocationmodel.h')
-rw-r--r--qt-models/maplocationmodel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-models/maplocationmodel.h b/qt-models/maplocationmodel.h
index e398a8091..8dff65eac 100644
--- a/qt-models/maplocationmodel.h
+++ b/qt-models/maplocationmodel.h
@@ -44,6 +44,8 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
int rowCount(const QModelIndex &parent) const override;
int count();
+ void add(MapLocation *);
+ void clear();
protected:
QHash<int, QByteArray> roleNames() const;