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

Mouse events that are synthesized from touch events do not inherit from QMouseEvent and casting to QMouseEvent crashes application

    XMLWordPrintable

Details

    • Windows

    Description

      When `Qt::AA_SynthesizeMouseForUnhandledTouchEvents` is enabled, the unaccepted touch events are sent again as mouse events. However, the synthesized mouse event is not actually a mouse event but a private `QMutableSinglePointEvent` event.

      We have code that deals with mouse events and casts incoming mouse events to `QMouseEvent`. Unfortunately, when a mouse event is synthesized from a touch event, this cast fails and the application crashes.

      We got around the problem by changing our code so that we cast to `QSinglePointEvent`. But this seems like a bug. I don't think an internal data structure should be exposed like this and when the event type comes in as a mouse event, it's expected that we just cast to a mouse event.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              uzumcuf Furkan Uzumcu
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes