Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/widgets/dlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ void DLabel::paintEvent(QPaintEvent *event)
palette.setBrush(foregroundRole(), DPaletteHelper::instance()->palette(this).brush(d_func()->color));
}

if (d->text != d_func()->lastText) {
// clear flag when text changed, avoid tooltip don't show new text
DToolTip::setShowToolTip(this, false);
d_func()->lastText = d->text;
}

QString text = d->text;
if (elideMode() != Qt::ElideNone) {
const QFontMetrics fm(fontMetrics());
Expand Down
1 change: 1 addition & 0 deletions src/widgets/private/dlabel_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class DLabelPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate

DPalette::ColorType color = DPalette::NoType;
Qt::TextElideMode elideMode = Qt::ElideNone;
QString lastText;
};

DWIDGET_END_NAMESPACE
Expand Down
Loading