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

If a dialog appears while a MouseArea in a Drawer is still being pressed then it is not possible to interact with the MouseArea after closing the dialog

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      If a dialog appears while a MouseArea in a Drawer is still being pressed then it is not possible to interact with the MouseArea after closing the dialog. This appears to open happen with touch devices as it works fine when using the mouse.

      In the example given, click on the first button, then on the new one that is presented, hold it down until the dialog is shown. Once the dialog is shown, then release and dismiss the dialog. Holding the original MouseArea again does not react anymore.

      import QtQuick 2.8
      import QtQuick.Controls 2.1
      
      ApplicationWindow {
          id: window
          width: 600
          height: 400
          visible: true
      
          Rectangle {
              anchors.centerIn: parent
              width: 100
              height: 100
              color: "Red"
      
              MouseArea {
                  anchors.fill: parent
                  onClicked: drawer.open()
              }
              Text {
                  anchors.centerIn: parent
                  text: "Open Drawer"
              }
          }
      
          Drawer {
              id: drawer
              width: 0.66 * window.width
              height: window.height
      
              Rectangle {
                  anchors.centerIn: parent
                  width: 100
                  height: 100
                  color: "Blue"
      
                  MouseArea {
                      id: ma
                      anchors.fill: parent
                      onPressed: {
                          console.log("Drawer Button - onPressed")
                          timer.start()
                      }
                      onReleased: console.log("Drawer Button - onReleased")
                      onClicked: console.log("Drawer Button - onClicked")
                      onCanceled: console.log("Drawer Button - onCancelled")
                      onPressAndHold: dialog.open()
                  }
                  Text {
                      anchors.centerIn: parent
                      text: "Open Dialog"
                  }
              }
          }
      
          Timer {
              id: timer
              running: false
              repeat: false
              interval: 1000
              onTriggered: dialog.open()
          }
      
          Dialog {
              id: dialog
              visible: false
              title: "Dialog Popup"
              modal: true
      
              contentItem: Rectangle {
                  color: "Green"
                  implicitWidth: 100
                  implicitHeight: 100
                  Text {
                      text: "Close Dialog"
                      anchors.centerIn: parent
                  }
                  MouseArea {
                      anchors.fill: parent
                      onClicked: dialog.accept()
                  }
              }
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              andysh Andy Shaw
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes