summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformnativeinterface_qpa.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-18 15:16:09 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-20 12:43:52 +0100
commit1ca05bb0c174d505469ac647818afaf537b41f43 (patch)
tree01653a1361ca8ed373e3ab77d46af2a15874bdfe /src/gui/kernel/qplatformnativeinterface_qpa.cpp
parent8060dd3c42982543b2b5949187fa5b5bb6aeff29 (diff)
Add support for platform plugin specific event filters.
The setEventFilter on the platform native interface allows subscribing to events on the backend by event name. Change-Id: Ib10077fbc69f0207edbae1177e7bbd18c8d0f9ae Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com> Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Diffstat (limited to 'src/gui/kernel/qplatformnativeinterface_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformnativeinterface_qpa.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformnativeinterface_qpa.cpp b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
index f9ddd1f72a..626f6a1e51 100644
--- a/src/gui/kernel/qplatformnativeinterface_qpa.cpp
+++ b/src/gui/kernel/qplatformnativeinterface_qpa.cpp
@@ -106,4 +106,51 @@ void QPlatformNativeInterface::setWindowProperty(QPlatformWindow *window, const
Q_UNUSED(value);
}
+/*!
+ \typedef QPlatformNativeInterface::EventFilter
+ \since 5.0
+
+ A function with the following signature that can be used as an
+ event filter:
+
+ \code
+ bool myEventFilter(void *message, long *result);
+ \endcode
+
+ \sa setEventFilter()
+*/
+
+/*!
+ \fn EventFilter QPlatformNativeInterface::setEventFilter(const QByteArray &eventType, EventFilter filter)
+ \since 5.0
+
+ Replaces the event filter function for the native interface with
+ \a filter and returns the pointer to the replaced event filter
+ function. Only the current event filter function is called. If you
+ want to use both filter functions, save the replaced EventFilter
+ in a place where you can call it from.
+
+ The event filter function set here is called for all messages
+ received from the platform if they are given type \eventType.
+ It is \i not called for messages that are not meant for Qt objects.
+
+ The type of event is specific to the platform plugin chosen at run-time.
+
+ The event filter function should return \c true if the message should
+ be filtered, (i.e. stopped). It should return \c false to allow
+ processing the message to continue.
+
+ By default, no event filter function is set. For example, this function
+ returns a null EventFilter the first time it is called.
+
+ \note The filter function here receives native messages,
+ for example, MSG or XEvent structs. It is called by the platform plugin.
+*/
+QPlatformNativeInterface::EventFilter QPlatformNativeInterface::setEventFilter(const QByteArray &eventType, QPlatformNativeInterface::EventFilter filter)
+{
+ Q_UNUSED(eventType);
+ Q_UNUSED(filter);
+ return 0;
+}
+
QT_END_NAMESPACE