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

Property bindings not working for Popup in QML Window Embedding

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0 Beta3
    • 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  
      
         Window {
          id: toolbarWindow
          y: 200
          visible: true
          parent: root
          width: 300
          height: 600
          color: "transparent"    
            
            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: 3
          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()
                }
              }
            }
          }
        }
      }
        
      •  Start the app, click button "open" to show the popup, the popupWindow width/height is binding to root window's width/height
      • Maximize or resize the root window, the popWindow is still keep original width/height, the property bindings not working.

       

       

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              robbie_li Xiaowei Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes