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

MouseArea onPressAndHold event when using a tactile input to push something on a StackView

    XMLWordPrintable

Details

    Description

      I found an asymmetrical behavior of the MouseArea between a classic mouse input and a tactile input.

      I'm using a MouseArea to perform some action with the onClicked event, and to push something on a StackView with the onPressAndHold event.

      In my example code, the MouseArea border is green when MouseArea.pressed is false, red when true.

      While using a classic mouse input, everything works as intended.
      While using a tactile input, the behavior of the MouseArea doesn't mirror the behavior of the classic mouse input, MouseArea.pressed is stuck to true, messing with the input.

      Description of the intended behavior :

      Using a classic mouse input

      Press on the MouseArea, the pressed property is set to true, the border.color gets red.
      Release on the MouseArea, the pressed property is set to false, the border.color gets green.
      Click on the MouseArea, the doSomething function is called.
      PressAndHold on the MouseArea, an other element is pushed on the StackView, Canceled event is trigger and MouseArea.pressed is reset to false.

      Then go back to the previous Item in the StackView.

      You can repeat the precedent actions over and over.

      Description of the bugged behavior :

      Using a tactile input

      Press on the MouseArea, the pressed property is set to true, the border.color gets red.
      Release on the MouseArea, the pressed property is set to false, the border.color gets green.
      Click on the MouseArea, the doSomething function is called.
      PressAndHold on the MouseArea, an other element is pushed on the StackView, Canceled event is not triggerred and MouseArea.pressed stays true.

      Then go back to the previous Item in the StackView.

      The MouseArea.pressed is stuck to true, every next Press or Click is directly seen as a PressAndHold by the MouseArea...
      You cannot Click on the MouseArea anymore and call the doSomething function.

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            Coding_Eric Eric Barral
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes