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

Popup does not respect the opacity of its parent item

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 6.8.0
    • Quick: Controls 2
    • None
    • Windows

    Description

      When the parent item changes its opacity, the Popup item doesn't follow the parent's opacity like other objects do. The following program demonstrates the issue:

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Rectangle {
              id: box
              anchors.fill: parent
              visible: true
              color: "#60FFFF00"
      
              Flow {
                  anchors.fill: parent
                  Rectangle {
                      width: 200
                      height: 100
                      color: "blue"
                      Label {
                          text: "Rectangle outside Popup"
                      }
                  }
                  Item {
                      width: 200
                      height: 100
                      Popup {
                          closePolicy: Popup.NoAutoClose
                          visible: true
      
                          anchors.centerIn: parent
                          width: parent.width
                          height: parent.height
      
                          Rectangle {
                              anchors.fill: parent
                              color: "darkgreen"
                              Label {
                                  text: "Rectangle within Popup"
                              }
                          }
                      }
                  }
              }
          }
      
          SequentialAnimation {
              loops: Animation.Infinite
              running: true
              NumberAnimation {
                  target: box
                  property: "opacity"
                  from: 1.0
                  to: 0.0
                  duration: 500
              }
              NumberAnimation {
                  target: box
                  property: "opacity"
                  from: 0.0
                  to: 1.0
                  duration: 500
              }
          }
      }

      In the given example program, the opacity of the rectangle outside the Popup is affected by its parent item's opacity. But the one within the Popup doesn't.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            jclink Jessia Clinkscale
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes