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

onPositionChanged does not get modifiers on mouseDrag in qml TestCase

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.1
    • Fix Version/s: None
    • Component/s: Testing: QuickTest
    • Labels:
      None

      Description

      Hi,

      onPositionChanged does not get modifiers on mouseDrag in qml TestCase :

       

      import QtQuick 2.14
      import QtTest 1.14
      Item {
        width: 200
        height: 200
        id: item
        MouseArea {
          anchors.fill: parent
          onClicked: {
            print("click ", mouse.modifiers)
          }
          onPositionChanged: {
            print('drag : ', mouse.modifiers)
          }
        }
      
        TestCase {
          name: "my test"
          when: windowShown
      
          function test_click() {
            mouseClick(item, item.width / 2,item.height / 2, Qt.LeftButton, Qt.ControlModifier,  -1)
            mouseDrag(item, item.width / 2,  item.height / 2,1, 1, Qt.LeftButton, Qt.ControlModifier,  -1)
          }
        }
      }
      
      QDEBUG : qmltests::my test::test_click() qml: click  67108864
      QDEBUG : qmltests::my test::test_click() qml: drag :  0
      QDEBUG : qmltests::my test::test_click() qml: drag :  0
      QDEBUG : qmltests::my test::test_click() qml: click  67108864
      

      Line 1: standalone mouseClick modifier is ok
      Line 2 and 3 : dragging no modifier NOT OK
      Line 4 : onClicked after dragging : modifier is shown OK

       

      But when  used outside test, it's ok

      So I think it's only mouseDrag fault.

      Happy Confinement

      Jimmy

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              jgirardet Jimmy Gir
              Votes:
              6 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes