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

Transparency not working correctly for Window Embedding in QML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.7.0 Beta3, 6.7.0
    • None
    • Windows

    Description

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      
      ApplicationWindow {
        id: root  
         width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
        color: "darkseagreen"
        z: 99  
         
         WindowContainer {
          window: openGLWindow
          anchors.centerIn: parent
        }  
         
         Window {
            id: toolbarWindow
      
          y: 200
          visible: true
          parent: root
          width: 300
          height: 600
          color: "transparent"    
      
            Popup {
            id: pop1
            anchors.centerIn: parent      z: 999
            width: 200
            height: 400
            modal: true
            focus: true
            closePolicy: Popup.CloseOnEscape | Popup.CloseOnReleaseOutside
          }    
            
            Frame {      
               anchors.left: parent.left
            anchors.verticalCenter: parent.verticalCenter      
               background: Rectangle {
              color: "thistle"
            }      
               contentItem: ColumnLayout {
              spacing: 10        
                  Button {
                text: "button1"
                onClicked: {
                  print("button1 clicked")
                  popupWindow.visible = true
                  pop.open()
                }
              }        
                  Button {
                text: "button2"
                onClicked: {
                  print("button2 clicked")
                  pop1.open()
                }
              }
            }
          }
        }  
         Button {
          text: "open"
          onClicked: {
            print("open clicked")
            popupWindow.visible = true
            pop.open()
          }
        }  
         
         Window {
          id: popupWindow   
            x: 0
          y: 0
          z: 999
          width: root.width
          height: root.height
          parent: root
          color: "#cc313030"    
            Popup {
            id: pop
            anchors.centerIn: parent
            width: 200
            height: 400
            modal: true
            focus: true
            closePolicy: Popup.CloseOnEscape | Popup.CloseOnReleaseOutside      
               onClosed: {
              popupWindow.hide()
            }      
               background: Rectangle {
              color: "purple"
            }      
               contentItem: ColumnLayout {
              Text {
                text: "Popup Dialog"
              }
              Button {
                text: "Close"
                onClicked: {
                  pop.close()
                }
              }
            }
          }
        }
      } 

      The toolbarWindow background is not work, fully black.

      Attachments

        1. image-2024-02-21-09-14-04-485.png
          8 kB
          Xiaowei Li
        2. image-2024-02-21-09-14-43-111.png
          40 kB
          Xiaowei Li
        3. image-2024-03-08-10-28-23-197.png
          36 kB
          Tor Arne Vestbø
        4. WindowEmbeddedSample.zip
          4 kB
          Xiaowei Li

        Issue Links

          For Gerrit Dashboard: QTBUG-122590
          # Subject Branch Project Status CR V

          Activity

            People

              owolff Oliver Wolff
              robbie_li Xiaowei Li
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change