From 1603ba23656c8c31dc05fe9b3f1e12b22e29989a Mon Sep 17 00:00:00 2001 From: David Faure Date: Sat, 23 Jun 2012 21:48:53 +0200 Subject: Provide public API for native event filtering, moved up from QPA. The previous API was hard to use (global function, no type safety, manual chaining), and confusing (app vs dispatcher split only made sense on Windows). Installing and removing out of order would have the risk of setting back a dangling pointer (crash). Meanwhile QPA added type safety, and this new API models the QObject::installEventFilter API for ease of use. The virtual method is in a new interface, QAbstractNativeEventFilter. QPA was even calling the dispatcher event filter with QPA-private event classes, which made no sense (refactoring leftover from when the code was in the dispatcher). Now the QPA plugins trigger the qcoreapp event filters with the actual native events directly. Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882 Reviewed-by: Marius Storm-Olsen --- src/plugins/platforms/qnx/qqnxbpseventfilter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms/qnx/qqnxbpseventfilter.h') diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.h b/src/plugins/platforms/qnx/qqnxbpseventfilter.h index aafca0f989..164cb0291b 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.h +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.h @@ -44,6 +44,7 @@ #include #include +#include #include @@ -58,7 +59,7 @@ class QQnxScreen; class QQnxScreenEventHandler; class QQnxVirtualKeyboardBps; -class QQnxBpsEventFilter : public QObject +class QQnxBpsEventFilter : public QObject, public QAbstractNativeEventFilter { Q_OBJECT public: @@ -76,8 +77,7 @@ public: void unregisterForDialogEvents(QQnxFileDialogHelper *dialog); private: - static bool dispatcherEventFilter(void *message); - bool bpsEventFilter(bps_event_t *event); + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; bool handleNavigatorEvent(bps_event_t *event); -- cgit v1.2.3