Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.0.2, 5.1.0 , 5.2.0
-
None
Description
When a QLabel is inside a QHBoxLayout with a stretch added before the label, it doesn't redraw correctly when doing setText("") it seems.
I added a minimal C++ program to reproduce the bug. I tested it on Qt 5.0.2 and Qt 5.1.0, gcc, Ubuntu 13.10.
Expected behavior: when timer fires, both labels are cleared.
Actual behavior: only the second label is cleared. The first label appears unchanged. The first label gets cleared when its window gained focus.
For the minimal example, using clear() instead works around the issue. In my real code, even that or doing update() after setting the text doesn't help, only redraw() does.
StackOverflow thread with screenshots: http://stackoverflow.com/q/21890462/2085149
Attachments
For Gerrit Dashboard: QTBUG-36945 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
79181,1 | Fix QLabel::setText("") to update the label as appropriate | stable | qt/qtbase | Status: ABANDONED | -1 | 0 |