diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-02-10 14:41:59 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-10 09:57:04 -0800 |
commit | cafc7e4b1338156c9a3294a8f1037b5a31fffdbb (patch) | |
tree | 5a543404a6ec221b0450865409801584ec1ce7f5 /qt-ui/profile/diveprofileitem.h | |
parent | 2f2c9e371ceeba4cf45575b5a30815bcd562f853 (diff) | |
download | subsurface-cafc7e4b1338156c9a3294a8f1037b5a31fffdbb.tar.gz |
Clear the data when the model resets.
This patch does a few things:
1 - reset the model when user closes the dive file
2 - connects the 'rowsAboutToBeRemoved' in a way that the graphics can
remove their polygons too
3 - adds a 'clear' virtual method so items that don't follow the rules can
clean themseves up.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.h')
-rw-r--r-- | qt-ui/profile/diveprofileitem.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.h b/qt-ui/profile/diveprofileitem.h index 80c840736..b47cbd513 100644 --- a/qt-ui/profile/diveprofileitem.h +++ b/qt-ui/profile/diveprofileitem.h @@ -41,9 +41,11 @@ public: void setHorizontalDataColumn(int column); void setVerticalDataColumn(int column); virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0) = 0; + virtual void clear(){}; public slots: virtual void preferencesChanged(); virtual void modelDataChanged(const QModelIndex& topLeft = QModelIndex(), const QModelIndex& bottomRight = QModelIndex()); + virtual void modelDataRemoved(const QModelIndex& parent, int from, int to); protected: /* when the model emits a 'datachanged' signal, this method below should be used to check if the * modified data affects this particular item ( for example, when setting the '3m increment' |