diff --git a/qt-ui/profile/divetextitem.cpp b/qt-ui/profile/divetextitem.cpp index 4c0137177..b3d5c39aa 100644 --- a/qt-ui/profile/divetextitem.cpp +++ b/qt-ui/profile/divetextitem.cpp @@ -14,11 +14,16 @@ DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent), textItem->setPen(Qt::NoPen); } +void DiveTextItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + updateText(); + QGraphicsItemGroup::paint(painter, option, widget); +} + void DiveTextItem::setAlignment(int alignFlags) { if (alignFlags != internalAlignFlags) { internalAlignFlags = alignFlags; - updateText(); } } @@ -31,7 +36,6 @@ void DiveTextItem::setScale(double newscale) { if (scale != newscale) { scale = newscale; - updateText(); } } @@ -39,7 +43,6 @@ void DiveTextItem::setText(const QString &t) { if (internalText != t) { internalText = t; - updateText(); } } diff --git a/qt-ui/profile/divetextitem.h b/qt-ui/profile/divetextitem.h index 0c0ec4b86..26e45d746 100644 --- a/qt-ui/profile/divetextitem.h +++ b/qt-ui/profile/divetextitem.h @@ -18,6 +18,7 @@ public: void setScale(double newscale); void setBrush(const QBrush &brush); const QString &text(); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: void updateText();