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

Mac: Transparent window doesn't erase rect before painting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.3.2, 5.4.0 RC
    • Fix Version/s: 5.4.0
    • Component/s: QPA
    • Environment:
      Mac OS X 10.9.5
    • Platform/s:
      macOS
    • Commits:
      7d43fb0c10726be005325a4b5c79b3d7f7722c37

      Description

      When calling update() explicitly in transparent widget it doesn't clear background before paintEvent on Mac. Erasing works fine for example resizing window that updates widget. Test with attached example by resizing painted rectangle in transparent window. Old painted rectangle is not erased until resizing the window. Same code works fine on Windows so should work also on Mac.

      There's also workaround to erase rect before painting other items:

          void paintEvent(QPaintEvent* e) {
              QPainter painter(this);
              // WORKAROUND FOR MAC OS X:
              painter.setCompositionMode(QPainter::CompositionMode_Clear);
              painter.eraseRect(rect());
              painter.setCompositionMode(QPainter::CompositionMode_SourceOver);
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            qtcomsupport Qt Support
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes