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

Buttons / mouseArea doesn't works under Drawer's drag area

    XMLWordPrintable

Details

    • 375e400390 (qt/qtdeclarative/dev) 375e400390 (qt/tqtc-qtdeclarative/dev)
    • Shovelling Snow, Q1/2020 Finale, Q2/2020 kick off

    Description

      Dear,

      In QML, if I set a Drawer let's say with a dragMargin of 200, then any button in this area doesn't works, because the pressed or clicked events are not propagated.

      example :

      import QtQuick 2.7
      import QtQuick.Controls 2.1
      import QtQuick.Layouts 1.0
      
      ApplicationWindow {
          visible: true
          width: 400
          height: 400
          title: qsTr("Hello World")
      
          Drawer {
              id: drawer
              dragMargin: 200
      
              edge: Qt.LeftEdge
      
              width: 300
              height: 400
      
              Rectangle {
                  anchors.fill: parent
                  color: "red"
              }
          }
      
          Column {
              width: parent.width
              Row {
                  Button {
                      width: 200
                      text: "Button\nLeft"
                      onClicked: console.log("Button Left clicked") //Not working
                  }
                  Button {
                      width: 200
                      text: "Button\nRight"
                      onClicked: console.log("Button Right clicked") //ok
                  }
              }
      
              Row {
                  Rectangle {
                      width: 200
                      height: 50
                      Label {
                          anchors.centerIn: parent
                          text: "MouseArea\nLeft"
                      }
                      MouseArea {
                          anchors.fill: parent
                          onPressed: console.log("MouseArea Left onPressed") //Not working
                          onClicked: console.log("MouseArea Left onClicked") //Not working
                      }
                  }
                  Rectangle {
                      width: 200
                      height: 50
                      Label {
                          anchors.centerIn: parent
                          text: "MouseArea\nRight"
                      }
                      MouseArea {
                          anchors.fill: parent
                          onPressed: console.log("MouseArea Right onPressed") //ok
                          onClicked: console.log("MouseArea Right onClicked") //ok
                      }
                  }
              }
          }
      }
      

      Attachments

        1. qtbug59141-with-slider.zip
          3 kB
          Nahomi Gröhn
        2. qtbug59141-with-slider-screenshot.png
          59 kB
          Nahomi Gröhn

        Issue Links

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

          Activity

            People

              dorisverria Doris Verria
              aridet aridet
              Votes:
              20 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes