From f8a4f8de8159bb60235af170d2acb603ec40ccad Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 22 Jan 2014 18:25:35 -0200 Subject: Do not delete / new object that can be cached. This way we will always have this object on screen, and as soon as the model changes, it's contents will change. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/diveprofileitem.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'qt-ui/profile/diveprofileitem.cpp') diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp index 5599b7eaf..e740640e2 100644 --- a/qt-ui/profile/diveprofileitem.cpp +++ b/qt-ui/profile/diveprofileitem.cpp @@ -367,6 +367,8 @@ void DiveCalculatedCeiling::modelDataChanged() AbstractProfilePolygonItem::modelDataChanged(); // Add 2 points to close the polygon. QPolygonF poly = polygon(); + if (poly.isEmpty()) + return; QPointF p1 = poly.first(); QPointF p2 = poly.last(); -- cgit v1.2.3-70-g09d2