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>
This commit is contained in:
Tomaz Canabrava 2014-01-23 16:03:19 -02:00 committed by Dirk Hohndel
parent 563c39b822
commit 43cf4fb984
2 changed files with 12 additions and 14 deletions

View file

@ -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;