Logo Search packages:      
Sourcecode: qt4-x11 version File versions

bool QObject::eventFilter ( QObject ,
QEvent  
) [virtual, inherited]

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: doc/src/snippets/code/src_corelib_kernel_qobject.cpp 6

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.

Warning:
If you delete the receiver object in this function, be sure to return true. Otherwise, Qt will forward the event to the deleted object and the program might crash.
See also:
installEventFilter()

Reimplemented in MainWindow, KeyPressEater, QDialog, QFontDialog, QGraphicsProxyWidget, QGraphicsScene, QItemDelegate, QStyledItemDelegate, QWidgetAction, QX11EmbedWidget, QX11EmbedContainer, QMotifStyle, QPlastiqueStyle, QWindowsStyle, QCompleter, QFocusFrame, QMdiArea, QMdiSubWindow, QMenuBar, QScrollArea, QSizeGrip, QWorkspace, Q3FileDialog, Q3Wizard, Q3IconView, Q3ListBox, Q3ListView, Q3Table, Q3DataTable, Q3TextEdit, Q3ComboBox, Q3DockArea, Q3DockWindow, Q3MainWindow, Q3ScrollView, Q3WhatsThis, QtWindowListMenu, and FindWidget.

Definition at line 1278 of file qobject.cpp.

Referenced by QDialog::eventFilter(), FindWidget::eventFilter(), QGraphicsProxyWidget::eventFilter(), QWindowsStyle::eventFilter(), QMdiSubWindow::eventFilter(), QMdiArea::eventFilter(), QWorkspace::eventFilter(), QWidgetAction::eventFilter(), QSizeGrip::eventFilter(), QCompleter::eventFilter(), KeyPressEater::eventFilter(), QMotifStyle::eventFilter(), QX11EmbedWidget::eventFilter(), Q3MainWindow::eventFilter(), Q3ComboBox::eventFilter(), MainWindow::eventFilter(), QX11EmbedContainer::eventFilter(), Q3ScrollView::eventFilter(), and QApplication::notify().

{
    return false;
}


Generated by  Doxygen 1.6.0   Back to index