Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80167

Widgets no longer repaint if a paint-on-screen widget is updated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P1: Critical
    • Resolution: Unresolved
    • Affects Version/s: 5.6.3, 5.9.8, 5.12.6, 5.13.1, 5.15
    • Fix Version/s: None
    • Labels:
    • Platform/s:
      All

      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:
        1. Python option: PaintOnScreenIssue.py for PyQt5 or PySide2.
        2. 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

        1. PaintOnScreenIssue.mp4
          578 kB
        2. PaintOnScreenIssue.py
          2 kB
        3. PaintOnScreenIssue.tar.gz
          1 kB
        4. QTBUG-80167_2.patch
          4 kB
        5. QTBUG-80167.patch
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            vestbo Tor Arne Vestbø
            Reporter:
            christian.aguilera.foundry Christian Aguilera
            PM Owner:
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes