summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qabstractnativeeventfilter.cpp
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2016-08-28 17:33:35 +0200
committerSamuel Gaist <samuel.gaist@edeltech.ch>2016-09-20 21:23:32 +0000
commit23e76a12b9419e1b213cbacf625d3a0b1921dd92 (patch)
tree8f4b91e045cf170e523313d9883b5987be5543ee /src/corelib/kernel/qabstractnativeeventfilter.cpp
parent9f2c260f881b384ae719c60ea9833feb42251058 (diff)
Doc: add macOS example of QAbstractNativeEventFilter implementation
This patch adds a sample native event filter that can be easily integrated in a project. Task-number: QTBUG-53209 Change-Id: Iedf6df33a3de5b01dc7871cca5e7897a5b485733 Reviewed-by: Topi Reiniƶ <topi.reinio@theqtcompany.com>
Diffstat (limited to 'src/corelib/kernel/qabstractnativeeventfilter.cpp')
-rw-r--r--src/corelib/kernel/qabstractnativeeventfilter.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/corelib/kernel/qabstractnativeeventfilter.cpp b/src/corelib/kernel/qabstractnativeeventfilter.cpp
index 9892cc7333..15e6d17c18 100644
--- a/src/corelib/kernel/qabstractnativeeventfilter.cpp
+++ b/src/corelib/kernel/qabstractnativeeventfilter.cpp
@@ -90,7 +90,7 @@ QAbstractNativeEventFilter::~QAbstractNativeEventFilter()
In both cases, the \a message can be casted to a MSG pointer.
The \a result pointer is only used on Windows, and corresponds to the LRESULT pointer.
- On Mac, \a eventType is set to "mac_generic_NSEvent", and the \a message can be casted to an EventRef.
+ On macOS, \a eventType is set to "mac_generic_NSEvent", and the \a message can be casted to an NSEvent pointer.
On Blackberry (not plain QNX) \a eventType is set to "bps_event_t", and the \a message can be casted
to a bps_event_t pointer.
@@ -99,8 +99,19 @@ QAbstractNativeEventFilter::~QAbstractNativeEventFilter()
the \a message out, i.e. stop it being handled further, return
true; otherwise return false.
- Example:
+ \b {Linux example}
\snippet code/src_corelib_kernel_qabstractnativeeventfilter.cpp 0
+
+ \b {macOS example}
+
+ mycocoaeventfilter.h:
+ \snippet code/src_corelib_kernel_qabstractnativeeventfilter.h 0
+
+ mycocoaeventfilter.mm:
+ \snippet code/src_corelib_kernel_qabstractnativeeventfilter.mm 0
+
+ myapp.pro:
+ \snippet code/src_corelib_kernel_qabstractnativeeventfilter.pro 0
*/
QT_END_NAMESPACE