diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2014-01-23 16:03:19 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-23 21:11:14 -0800 |
commit | 43cf4fb98417fc6fd2124704fca7f46988d57e72 (patch) | |
tree | a231c19b89339523ec10225fdfa43800a53cec52 /qt-ui/profile/diveprofileitem.cpp | |
parent | 563c39b8221ac2e3730c9f51a0e890b42af8ca78 (diff) | |
download | subsurface-43cf4fb98417fc6fd2124704fca7f46988d57e72.tar.gz |
Move profile item to be used as cache.
the profile item should also use the model to know when to
change something, this makes it happen.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveprofileitem.cpp')
-rw-r--r-- | qt-ui/profile/diveprofileitem.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index f00fff688..774938c95 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -107,6 +107,9 @@ void DiveProfileItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* o void DiveProfileItem::modelDataChanged() { + if (!hAxis || !vAxis || !dataModel || hDataColumn == -1 || vDataColumn == -1 || dataModel->rowCount() == 0) + return; + AbstractProfilePolygonItem::modelDataChanged(); if (polygon().isEmpty()) return; |