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

[QQC2] orientation change breaks the position and size of the Popup

    XMLWordPrintable

Details

    • f1e139b9ac02313f541ed6749f05e265f4c8bf13

    Description

      Changing orientation of the application breaks the position and size of the Popup.

      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Controls 2.1
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Rotation")
          id: root
      
          property bool rotateDialog: false
          property bool rotateMain: false
      
          Rectangle {
              color: "pink"
              rotation: rotateMain ? 90 : 0
              anchors.centerIn: parent
              width: rotateMain ? parent.height : parent.width
              height: rotateMain ? parent.width : parent.height
      
              Popup {
                  id: popup
      
                  x: 80
                  y: 60
                  width: 320
                  height: 240
                  background: Rectangle{
                      color: "blue"
                      rotation: rotateDialog ? 90 : 0
                  }
                  contentItem: Item {
      
                  }
                  closePolicy: Popup.NoAutoClose
              }
      
              Button {
                  id: popupButton
                  anchors.left: parent.left
                  anchors.bottom: parent.bottom
                  text: popup.visible ? "Close Popup" : "Open Popup"
                  onClicked: popup.visible ? popup.close() : popup.open()
              }
      
              Button {
                  id: rotateButton
                  anchors.left: popupButton.right
                  anchors.bottom: parent.bottom
                  text: "Rotate Popup"
                  onClicked: rotateDialog = !rotateDialog
              }
      
              Button {
                  id: rotateMainButton
                  anchors.left: rotateButton.right
                  anchors.bottom: parent.bottom
                  text: "Rotate Main"
                  onClicked: rotateMain = !rotateMain
              }
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              karimpinter Karim Pinter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes