summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-26 15:10:00 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-06-04 22:29:15 +0200
commitc7b457e287232d235cd56fcb0dd106f4617d96f0 (patch)
tree6078ee902453eef658c09fb50127743fcfb6dbe7 /src/widgets
parent37b132cd4e081821ddc261d24abe8f914123547a (diff)
QLabel: create the text control when getting polished, if necessary
This amends 7bee4e9cb3750be4573e1872f52023081b014500, and makes sure that the text control is created even if the attributes that define whether it's needed are changed after a call to setText or setTextInteractionFlags, where it is otherwise created. Task-number: QTBUG-84080 Pick-to: 5.15 Change-Id: I3be27f35bc83944948027345535d1202a7b97163 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qlabel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index 152c250f69..7ab7083a13 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -1025,6 +1025,9 @@ bool QLabel::event(QEvent *e)
) {
d->setLayoutItemMargins(QStyle::SE_LabelLayoutItem);
d->updateLabel();
+ } else if (type == QEvent::Polish) {
+ if (d->needTextControl())
+ d->ensureTextControl();
}
return QFrame::event(e);