summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qapplication_x11.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-13 18:28:31 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-13 18:28:31 (GMT)
commitd012e5e808526e84507134656ca97c3884dae47b (patch)
tree9da70fead4e2b4110dee84fc1e55249ac7a81755 /src/gui/kernel/qapplication_x11.cpp
parent0b3183427395be7dae29ba91254b00b0845b72af (diff)
parent019032c93b7397c7239ec99ec44b4923df31533b (diff)
downloadQt-d012e5e808526e84507134656ca97c3884dae47b.zip
Qt-d012e5e808526e84507134656ca97c3884dae47b.tar.gz
Qt-d012e5e808526e84507134656ca97c3884dae47b.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (25 commits) run depend_command even if the binary has no absolute path fix scaleFactor/totalScaleFactor in QPinchGestureRecognizer Added velocity property to the QPanGesture. Changed the speed property on QSwipeGesture to velocity fix typos in comment unbreak test Don't add generic subdirs project twice. Remove debug, quiet warnings. Fix memory leaks and valgrind errors. QStroker: Fix erroneous SvgMiterJoin behavior for parallel lines Revert "Properly implement qobject_cast for const pointers." Bearer management: Fix compilation with namespace. fetch next token after class definition opening delay next token fetching when opening namespace don't let operator overloads confuse us don't try to show source when no locations are given Implement a private API for setting title widgets Fix the bug for QSettings on Windows, to store qint32/quint32, qint64/quint64 in Windows registry. fix CRLF Added private API to install an x11EventFilter ...
Diffstat (limited to 'src/gui/kernel/qapplication_x11.cpp')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index 7495f6d..e7b7ed8 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -400,11 +400,39 @@ QTabletDeviceDataList *qt_tablet_devices()
extern bool qt_tabletChokeMouse;
#endif
+typedef bool(*QX11FilterFunction)(XEvent *event);
+
+Q_GLOBAL_STATIC(QList<QX11FilterFunction>, x11Filters)
+
+Q_GUI_EXPORT void qt_installX11EventFilter(QX11FilterFunction func)
+{
+ Q_ASSERT(func);
+
+ if (QList<QX11FilterFunction> *list = x11Filters())
+ list->append(func);
+}
+
+Q_GUI_EXPORT void qt_removeX11EventFilter(QX11FilterFunction func)
+{
+ Q_ASSERT(func);
+
+ if (QList<QX11FilterFunction> *list = x11Filters())
+ list->removeOne(func);
+}
+
+
static bool qt_x11EventFilter(XEvent* ev)
{
long unused;
if (qApp->filterEvent(ev, &unused))
return true;
+ if (const QList<QX11FilterFunction> *list = x11Filters()) {
+ for (QList<QX11FilterFunction>::const_iterator it = list->constBegin(); it != list->constEnd(); ++it) {
+ if ((*it)(ev))
+ return true;
+ }
+ }
+
return qApp->x11EventFilter(ev);
}