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

Documentation for QAbstractNativeEventFilter is woefully inadequate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.6.2
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      OSX
    • Commits:
      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.

        Attachments

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

          Activity

            People

            Assignee:
            sgaist Samuel Gaist
            Reporter:
            danny77uk Daniel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes