Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.4.1
-
None
-
OSX
-
23e76a12b9419e1b213cbacf625d3a0b1921dd92
Description
I tried to use QAbstractNativeEventFilter, a new class introduced in Qt5, to work around QTBUG-29497 by intercepting the native events broadcast when the user triggers NSMenuItems. This is fairly easy in Cocoa.
But the documentation for QAbstractNativeEventFilter is incomplete and I could not find a single example of someone having successfully used this class to intercept native events on OSX using Qt 5.
The documentation states:
"On Mac, eventType is set to "mac_generic_NSEvent", and the message can be casted to an EventRef."
EventRef refers to old style Carbon events and while it is possible to create 'modern' NSEvents using the eventWithEventRef class function, I wasn't able to do anything meaningful with the NSEvent instance created.
The latest Apple documentation I could find referring to Carbon EventRefs was dated 2002!
Without a working example, this class is effectively useless on Mac OSX.