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

Mac: Transparent window doesn't erase rect before painting

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.3.2, 5.4.0 RC
    • QPA
    • Mac OS X 10.9.5
    • macOS
    • 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

            sorvig Morten Sørvig
            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