KDEUI
Go to the documentation of this file.
25 #include <QWeakPointer>
27 #include <QAbstractEventDispatcher>
37 class KEventHackWidget :
public QWidget
41 bool publicX11Event(XEvent *e)
45 #elif defined(Q_WS_MAC)
46 bool publicMacEvent(EventHandlerCallRef caller, EventRef event)
48 return macEvent(caller, event);
50 #elif defined(Q_WS_WIN)
51 bool publicWinEvent(MSG *message,
long *result)
53 return winEvent(message, result);
58 class KSystemEventFilterPrivate :
public QObject
63 void filterWidgetDestroyed(
QObject *widget)
69 KSystemEventFilterPrivate()
74 m_nextFilter = QAbstractEventDispatcher::instance()->setEventFilter(
_k_eventFilter);
77 bool filterEvent(
void *message);
84 QAbstractEventDispatcher::EventFilter m_nextFilter;
91 return kSystemEventFilter->filterEvent(message);
94 bool KSystemEventFilterPrivate::filterEvent(
void *message)
96 if (!m_filters.isEmpty()) {
98 XEvent *xevt =
static_cast<XEvent*
>(message);
100 Q_FOREACH (
const QWeakPointer<QWidget> &wp, m_filters) {
102 if (static_cast<KEventHackWidget*>(w)->publicX11Event(xevt)) {
107 #elif defined(Q_WS_MAC)
119 #elif defined(Q_WS_WIN)
137 return m_nextFilter(message);
143 namespace KSystemEventFilter
148 kSystemEventFilter->m_filters.append(filter);
149 kSystemEventFilter->connect(filter, SIGNAL(destroyed(
QObject*)),
150 SLOT(filterWidgetDestroyed(
QObject*)));
155 QMutableListIterator< QWeakPointer<QWidget> > it(kSystemEventFilter->m_filters);
156 while (it.hasNext()) {
158 if (w == filter || w == 0) {
166 #include "ksystemeventfilter.moc"
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 20:19:53 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.