Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.6.3, 5.9.8, 5.12.6, 5.13.1, 5.15, 6.8
-
-
697e1b039 (dev), c198f7124 (6.7), 4e3c55e10 (6.6), f12634262 (tqtc/lts-6.5)
Description
Description:
When a widget with the WA_PaintOnScreen flag is updated via QWidget::update(), paint events on sibling widgets are omitted.
Reproduction steps:
- Use one of the following test apps:
- Python option: PaintOnScreenIssue.py for PyQt5 or PySide2.
- C++/CMake option: PaintOnScreenIssue.tar.gz for QtCreator.
- Launch the test app.
- Click on the top widget and move the mouse pointer; the widget's background will change color as the mouse position changes.
- After 5 seconds, the bottom widget will be updated, and the top widget will stop repainting (see attached video PaintOnScreenIssue.mp4).
A more technical description:
When QWidget::update() is called, a QEvent::UpdateRequest event is posted to the widget (or top level widget), and the QWidgetBackingStore::updateRequestSent private member is set, to avoid sending another event until the previous one has been processed. When the event is received, QWidgetBackingStore::sync() is invoked, and the private member is cleared, so that another update event can be posted.
However, if the widget has been marked with Qt::WA_PaintOnScreen, QWidgetBackingStore::sync() is never invoked; the private member is never cleared. The backing store is typically shared with top level windows and its children. Because the private member is not cleared at the expected time, paint events are skipped, and widgets stop repainting.
Attachments
For Gerrit Dashboard: QTBUG-80167 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
544016,9 | Decouple rate-limiting of paint-on-screen widgets from top level widget | dev | qt/qtbase | Status: MERGED | +2 | 0 |
552736,2 | Decouple rate-limiting of paint-on-screen widgets from top level widget | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
552786,2 | Decouple rate-limiting of paint-on-screen widgets from top level widget | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
553079,2 | Decouple rate-limiting of paint-on-screen widgets from top level widget | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
553139,1 | Decouple rate-limiting of paint-on-screen widgets from top level widget | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |