aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2014-01-23 16:07:22 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-23 21:11:15 -0800
commit0f5069784da9dd89c7c2d2b2a2de52d3f653d91c (patch)
tree5d6a555af94ebaf4b70750d218006e218ab1f63e /qt-ui/profile
parent43cf4fb98417fc6fd2124704fca7f46988d57e72 (diff)
downloadsubsurface-0f5069784da9dd89c7c2d2b2a2de52d3f653d91c.tar.gz
Prevent memory leak by removing the texts on the TemperatureItem
This patch prevents memory leak by adding the text on the list of 'delete me when model changes' items. it also makes things a bit more snappy because the scene doesn't have to deal with all of the texts bounding rectangles eveytime. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile')
-rw-r--r--qt-ui/profile/diveprofileitem.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-ui/profile/diveprofileitem.cpp b/qt-ui/profile/diveprofileitem.cpp
index 774938c95..42c3ecaea 100644
--- a/qt-ui/profile/diveprofileitem.cpp
+++ b/qt-ui/profile/diveprofileitem.cpp
@@ -249,6 +249,7 @@ void DiveTemperatureItem::createTextItem(int sec, int mkelvin)
text->setPos(QPointF(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin)));
text->setText(QString("%1%2").arg(deg, 0, 'f', 1).arg(unit));
// text->setSize(TEMP_TEXT_SIZE); //TODO: TEXT SIZE!
+ texts.append(text);
}
void DiveTemperatureItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)