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

Qt 6.8.1 ignores QMenu activation via injected QEvents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.8.1
    • GUI: Menus
    • None
    • All

    Description

      Activating menu items for automation purposes by posting QEvents and moving the mouse cursor does not work anymore for Squish in Qt 6.8.1.

      The bug was introduced with commit f0758fb1130b64e5acea63bf86e1991b569ea1e5 which was (supposed to be) subsequently picked to 6.7, 6.5 and 6.2.
      The problematic change is using QGuiApplicationPrivate::lastCursorPosition instead of QCursor::pos() because the former is not updated in this scenario while the latter is.

      Only one line from commit may be reverted to make Squish work again. It is line 2462 in qtbase/src/widgets/widgets/qmenu.cpp:

      const QPoint mouse = QGuiApplicationPrivate::lastCursorPosition.toPoint();
      

      Can be changed back to:

      QPoint mouse = QCursor::pos();
      

      Ideally Squish should be injecting QWidget replay events via QPA but that would mean vastly different code and behavior depending on the Qt version.

      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
              gesemeny Gennadii Semenyshyn
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes