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

Transparent QQuickView doesn't clear graphics buffer when moved

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      1. Set up a translucent window as shown below.
      2. Drag the window around.
      3. Minimize + restore the window.
      4. Goto 2

      Results
      "Phantom" images form within the window. Minimizing (or obscuring) the window resets things to normal, until the window is moved again.

      I couldn't improve things by playing around with QQuickWindow::setDefaultAlphaBuffer() or QQuickWindow::clearBeforeRendering().

      // main.cpp
      #include <QGuiApplication>
      #include <QQuickView>
      
      int main(int argc, char *argv[])
      {
          QGuiApplication app(argc, argv);
          QQuickWindow::setDefaultAlphaBuffer(true);
      
          QQuickView view;
          view.setSource(QUrl("main.qml"));
          view.setColor(QColor(0, 0, 0, 0)); // For transparency
          view.show();
      
          return app.exec();
      }
      
      // main.qml
      import QtQuick 2.0
      
      Rectangle {
          width: 600
          height: 480
          color: "transparent"
          
          Rectangle {
              width: 300
              height: 240
              anchors.centerIn: parent
              color: "red"
              opacity: 0.5
          }
      }
      

      Attachments

        1. qtbug36896_diag.diff
          1 kB
          Friedemann Kleint
        2. qtbug36896.zip
          2 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              lagocs Laszlo Agocs
              jksh Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes