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

unexpected anchors in ApplicationWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.12.1
    • Quick: Controls 2
    • None
    • All

    Description

      
      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.4
      
      ApplicationWindow {
          id: rootWindow
          
          visible: true
          width: 400
          height: 400
          title: qsTr("Hello World")
          
          header: ToolBar {}
          
          Popup {
              id: popup
              
              anchors.centerIn: parent
              
              width: 300
              height: 300
              
              
              modal: true
              padding: 0
              
              Rectangle {
                  anchors.fill: parent
                  color: "red"
              }
              
              Component.onCompleted: open()
          }
      }
      

       

      popup center is rootWindow.center + rootWindow.header.height, it's useless behaviour.

       

      another example:

       

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.4
      
      ApplicationWindow {
          id: rootWindow
          
          visible: true
          width: 400
          height: 400
          title: qsTr("Hello World")
          
          header: ToolBar {}
          
          Popup {
              id: popup
              
              anchors.centerIn: parent
              
              width: 300
              height: rootWindow.height
              
              
              modal: true
              padding: 0
              
              Rectangle {
                  anchors.fill: parent
                  color: "red"
              }
              
              Component.onCompleted: open()
          }
      }
      

       

      where is popup.center now? rootWindow.center + rootWindow.header.height / 2?

      why does it work like this?

      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
            luntik2012 luntik2012
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes