From 6f807f937764d0b80d38cd5e29983ad4ec2ae3c8 Mon Sep 17 00:00:00 2001 From: zecke Date: Tue, 07 Oct 2003 12:56:18 +0000 Subject: Just a small example on usage of an Event Filter... I needed that for debugging but it looks useful as an example --- (limited to 'libopie/big-screen/example/osplitter_mail.cpp') diff --git a/libopie/big-screen/example/osplitter_mail.cpp b/libopie/big-screen/example/osplitter_mail.cpp index 91442c8..4eaf3a9 100644 --- a/libopie/big-screen/example/osplitter_mail.cpp +++ b/libopie/big-screen/example/osplitter_mail.cpp @@ -22,6 +22,7 @@ class Folder { ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) : QWidget( p, name, fl ) { + qApp->installEventFilter( this ); m_lstFolders.setAutoDelete( true ); QHBoxLayout *lay = new QHBoxLayout(this); @@ -68,3 +69,14 @@ ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) ListViews::~ListViews() { } + + +bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { + if (!obj->isWidgetType() ) + return false; + if ( ev->type() == QEvent::MouseButtonRelease ) { + qWarning(" name %s, class %s", obj->name(), obj->className() ); + } + + return false; +} -- cgit v0.9.0.2