#include <qabstractscrollarea_p.h>
Inheritance diagram for QAbstractScrollAreaFilter:


Definition at line 82 of file qabstractscrollarea_p.h.
Public Member Functions | |
| QAbstractScrollAreaFilter (QAbstractScrollAreaPrivate *p) | |
| bool | eventFilter (QObject *o, QEvent *e) |
Private Attributes | |
| QAbstractScrollAreaPrivate * | d |
| QAbstractScrollAreaFilter::QAbstractScrollAreaFilter | ( | QAbstractScrollAreaPrivate * | p | ) | [inline] |
Definition at line 86 of file qabstractscrollarea_p.h.
References QObject::setObjectName().
00086 : d(p) 00087 { setObjectName(QLatin1String("qt_abstractscrollarea_filter")); }
Here is the call graph for this function:

Filters events if this object has been installed as an event filter for the watched object.
In your reimplementation of this function, if you want to filter the event out, i.e. stop it being handled further, return true; otherwise return false.
Example:
class MainWindow : public QMainWindow { public: MainWindow(); protected: bool eventFilter(QObject *obj, QEvent *ev); private: QTextEdit *textEdit; }; MainWindow::MainWindow() { textEdit = new QTextEdit; setCentralWidget(textEdit); textEdit->installEventFilter(this); } bool MainWindow::eventFilter(QObject *obj, QEvent *event) { if (obj == textEdit) { if (event->type() == QEvent::KeyPress) { QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); qDebug() << "Ate key press" << keyEvent->key(); return true; } else { return false; } } else { // pass the event on to the parent class return QMainWindow::eventFilter(obj, event); } }
Notice in the example above that unhandled events are passed to the base class's eventFilter() function, since the base class might have reimplemented eventFilter() for its own internal purposes.
Reimplemented from QObject.
Definition at line 88 of file qabstractscrollarea_p.h.
References d, o, QAbstractScrollAreaPrivate::viewport, and QAbstractScrollAreaPrivate::viewportEvent().
00089 { return (o == d->viewport ? d->viewportEvent(e) : false); }
Here is the call graph for this function:

1.5.1