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

Using qmltest to move the mouse doesn't set QQuickItem::isUnderMouse

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.10.0 Alpha
    • Testing: QuickTest
    • None

    Description

      This is because QQuickItem::isUnderMouse uses QGuiApplicationPrivate::lastCursorPosition that is set in QGuiApplicationPrivate::processMouseEvent but qmltest sends the events directly to the items totally bypassing the event processing (unlike qtest) so QGuiApplicationPrivate::lastCursorPosition is never updated.

       

      I tried making qmltest using qtest in https://codereview.qt-project.org/#/c/204413/ but there are too many existing tests (specially in qtquickcontrols2) that rely on the old behaviour to make this change feasible in the little time i have to work on Qt.

       

      I'm attaching a test you can use to prove that QQuickItem::isUnderMouse works once this is fixed.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            tsdgeos_kdab Albert Astals Cid
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes