mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 18:23:23 +00:00
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>
This commit is contained in:
parent
43cf4fb984
commit
0f5069784d
1 changed files with 1 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue