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

Quick (Popup Drawer) Rotation problem !

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.11.1
    • Quick: Controls 2
    • None
    • Windows

    Description

      import QtQuick 2.10
      import QtQuick.Controls 2.3
      
      ApplicationWindow
      {
          visible: true
          width  : 640
          height : 480
          title  : qsTr("Rotation")
          id     : root
      
          contentOrientation: rotateMain ? Qt.LandscapeOrientation : Qt.PortraitOrientation
      
          property bool rotateMain  : false
      
          Rectangle
          {
              anchors.fill: parent
              color: "pink"
              rotation: rotateMain ? 90 : 0
      
              Popup
              {
                  id: popup
      
                  x: 80
                  y: 60
                  width: 320
                  height: 240
                  background: Rectangle
                  {
                      color: "blue"
                  }
              }
      
              Row
              {
                  width: parent.width
                  height: parent.height * 0.1
                  anchors.bottom: parent.bottom
      
                  Button
                  {
                      id: rotateMainButton
                      text: "Rotate Main"
                      onClicked:
                      {
                          popup.modal= true    //note
                          popup.open()
                          rotateMain = !rotateMain
                      }
                  }
      
                  Button
                  {
                      id : leftShow
                      text: "showLeft"
                      onClicked:
                      {
                          leftDrawer.open();
                      }
                  }
                  Button
                  {
                      id : rightShow
                      text: "showRight"
                      onClicked:
                      {
                          rightDrawer.open();
                      }
                  }
              }
      
      
              //-----------------------------------left
              Drawer
              {
                  id    : leftDrawer
                  width : parent.width * 0.33
                  height: parent.height
                  edge  : Qt.LeftEdge
                  contentItem: Item
                  {
                      anchors.fill: parent
                      anchors.margins: 6
      
                      ListModel
                      {
                          id: listModel
                          ListElement { name: "one"      ; sn : 1 }
                          ListElement { name: "two"      ; sn : 2 }
                      }
      
                      Column
                      {
                          anchors.fill: parent
                          ListView
                          {
                              id: listView
                              width     : parent.width
                              height    : parent.height
                              model     : listModel
                              delegate  : del
                          }
                      }
      
                      Component
                      {
                          id:del
                          Button
                          {
                              width     : listView.width
                              height    : listView.height * 0.1
                              text      : name
                          }
                      }
                  }
              }
              //-----------------------------------right
              Drawer
              {
                  id         : rightDrawer
                  width      : parent.width * 0.33
                  height     : parent.height
                  edge       : Qt.RightEdge
                  contentItem: Item
                  {
                      anchors.fill: parent
                      anchors.margins: 6
      
                      ListModel
                      {
                          id: rightModel
                          ListElement { name: "1" ; sn : 1 }
                          ListElement { name: "2" ; sn : 2 }
                          ListElement { name: "3" ; sn : 3 }
                          ListElement { name: "4" ; sn : 4 }
                      }
                      Column
                      {
                          anchors.fill: parent
                          ListView
                          {
                              id        : rightView
                              width     : parent.width
                              height    : parent.height
                              model     : rightModel
                              delegate  : rightdel
                          }
                      }
      
                      Component
                      {
                          id:rightdel
                          Button
                          {
                              width : rightView.width
                              height: rightView.height * 0.1
                              text  : name
                          }
                      }
                  }
              }
          }
      }
      

      Attachments

        1. qml2popuprotationtest.zip
          5 kB
        2. 5.jpg
          5.jpg
          14 kB
        3. 4.jpg
          4.jpg
          16 kB
        4. 3.jpg
          3.jpg
          11 kB
        5. 2.jpg
          2.jpg
          17 kB
        6. 1.jpg
          1.jpg
          14 kB

        Issue Links

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

          Activity

            People

              vhilshei Volker Hilsheimer
              angelus li maoqing
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes