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

QML Drawer lockup when attached to top edge which does not coincide with screen top edge

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.11.2
    • Quick: Controls 2
    • None
    • Qt Commercial 5.11.2
      macOS 10.14
      Xcode 10.0
      Qt Creator 4.7.1
    • All
    • feed3b7b8077f2c9bba72c49e249fb96c262d72e

      The QML Drawer component goes into an infinite layout loop under these conditions:

      1. Drawer edge is set to Qt.TopEdge
      2. Drawer parent is set to something that is not full screen height

      See attached example project that recreates the problem. Just click the "Toggle Drawer" button.

      If the header is set to height of 0 or the edge is changed to something other than TopEdge, the drawer works as expected.

      import QtQuick 2.11
      import QtQuick.Window 2.11
      import QtQuick.Controls 2.4
      
      ApplicationWindow {
          id: applicationWindow
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          header: Rectangle {
              color: "red"
      
              // Make my height 0 and no lockup.
              height: 40
          }
      
          Button {
              anchors.centerIn: parent
              text: "Toggle Drawer"
              onClicked: drawer.opened ? drawer.close() : drawer.open()
          }
      
          Drawer {
              id: drawer
              width: applicationWindow.width
              height: 0.2 * applicationWindow.height
      
              // Parenting to something not full screen height seems to break TopEdge mode.
              parent: applicationWindow.contentItem
      
              // Change me to left or right and no lockup.
              edge: Qt.TopEdge
      
              Label {
                  anchors.centerIn: parent
                  text: "a drawer"
              }
          }
      }
      

        1. Bug2.zip
          4 kB
        2. qtbug71290.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            dhess David Hess
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes