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

mouseDrag in TestCase does not set the modifiers property of MouseEvent correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.14.2, 6.2.2
    • Fix Version/s: None
    • Component/s: Testing: QuickTest
    • Labels:
      None
    • Platform/s:
      Linux/X11

      Description

      Hello,
      I need to test interactions for my application. From the TestCase framework I did not managed to reproduce the behavior I have in my app

      • What I mean by "the behavior I have in my app" ?

      a MouseArea in my app listen to the positionChanged signal. When the 'onPositionChanged slot is triggered the 'modifiers' property of the MouseEvent is correctly setted

      • What I mean by "I did not managed to reproduce from TestCase" ?

      From a Testcase when I call mouseDrag function with modifiers parameter setted to something (let's say Qt.ControlModifier), the onPositionChanged triggers but the 'modifiers' property of the MouseEvent is 0. I expected something different from 0

      • What I noticed

      I test it with Qt5, same problem
      If I trigger interactions manually with my mouse during the test then 'mouse.modifiers' is ok

      I provide a minimal example of this problem, with a simple qml test file. Like I wrote in the file one of the test seems sick. I copy-paste here what I got from the testcase:

      PASS   : mouse_test::mouse_test::initTestCase()
      QDEBUG : mouse_test::mouse_test::test_mouse_click() qml: press | coord(50,50) | buttons(1) | modifiers(67108864)
      QDEBUG : mouse_test::mouse_test::test_mouse_click() qml: release | coord(50,50) | buttons(0) | modifiers(67108864)
      QDEBUG : mouse_test::mouse_test::test_mouse_click() qml: click | coord(50,50) | buttons(0) | modifiers(67108864)
      PASS   : mouse_test::mouse_test::test_mouse_click()
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: press | coord(50,50) | buttons(1) | modifiers(67108864)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: move | coord(59,59) | buttons(1) | modifiers(0)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: move | coord(83,83) | buttons(1) | modifiers(0)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: move | coord(116,116) | buttons(1) | modifiers(0)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: move | coord(150,150) | buttons(1) | modifiers(0)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: release | coord(150,150) | buttons(0) | modifiers(67108864)
      QDEBUG : mouse_test::mouse_test::test_mouse_drag() qml: click | coord(150,150) | buttons(0) | modifiers(67108864)
      PASS   : mouse_test::mouse_test::test_mouse_drag()
      PASS   : mouse_test::mouse_test::cleanupTestCase()

       

      From my point of view it seems like a bug. What do you think ?

       

      Best regards

        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:
              hlefevre Henry Lefevre
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes