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

Drawer bad behavior after close a popup menu

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.1
    • 5.7.0
    • Quick: Controls 2
    • None
    • Sony Xperi ION with Android 4.1
    • bc0fdae8fad4e199792b3f00ebcb74bd80473227

    Description

      The drawer open automatically after close the menu by dragging the finger abruptly over the screen. It has only happened in android, in desktop dont happen, at least I cant reproduce that.
      This is a sample of code, I attach too

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      import QtQuick.Controls.Material 2.0
      import QtQuick.Layouts 1.0
      
      ApplicationWindow {
          id: window
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
          header: ToolBar {
              Material.foreground: "white"
      
              RowLayout {
                  spacing: 20
                  anchors.fill: parent
      
                  ToolButton {
                      contentItem: Image {
                          fillMode: Image.Pad
                          horizontalAlignment: Image.AlignHCenter
                          verticalAlignment: Image.AlignVCenter
                          source: "qrc:/images/drawer.png"
                      }
                      onClicked: drawer.open()
                  }
      
                  Label {
                      id: titleLabel
                      text: "Testing"
                      font.pixelSize: 20
                      elide: Label.ElideRight
                      horizontalAlignment: Qt.AlignHCenter
                      verticalAlignment: Qt.AlignVCenter
                      Layout.fillWidth: true
                  }
      
                  ToolButton {
                      contentItem: Image {
                          fillMode: Image.Pad
                          horizontalAlignment: Image.AlignHCenter
                          verticalAlignment: Image.AlignVCenter
                          source: "qrc:/images/menu.png"
                      }
                      onClicked: optionsMenu.open()
      
                      Menu {
                          id: optionsMenu
                          x: parent.width - width
                          transformOrigin: Menu.TopRight
                          modal: true     //To avoid the click/touch capture of other component
                          dim: false      //No dark background, in windows dont work
      
                          MenuItem {
                              text: "Settings"
                          }
                          MenuItem {
                              text: "About"
                          }
                      }
                  }
              }
          }
      
      
      
          Drawer {
              id: drawer
              width: Math.min(window.width, window.height) / 3 * 2
              height: window.height
      
              ListView {
                  id: listView
                  currentIndex: -1
                  anchors.fill: parent
      
                  delegate: ItemDelegate {
                      width: parent.width
                      text: model.title
                      highlighted: ListView.isCurrentItem
                      onClicked: {
                          drawer.close()
                      }
                  }
      
                  model: ListModel {
                      ListElement { title: "BusyIndicator" }
                      ListElement { title: "Button" }
                      ListElement { title: "CheckBox" }
                      ListElement { title: "ComboBox" }
                  }
      
                  ScrollIndicator.vertical: ScrollIndicator { }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            camilo_del_real Camilo José del Real
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes