I want to catch all events for the application. How can i use this method to achive this? Please help me !!
+1
A:
You have to implement and provide a function and point to it.
For example:
bool myEventFilter(void *message, long *result)
{
// do something with message and result
}
And call it like this:
app->setEventFilter( myEventFilter );
Rupert Jones
2010-03-05 12:04:35
Thanks for answer. but with this implemention i am not able to catch any Event other than timer.
Shabs
2010-03-06 09:10:38
According to the documentation http://doc.trolltech.com/4.6/qcoreapplication.html#setEventFilter it should catch all events. I haven't tried it out properly though.
Rupert Jones
2010-03-06 10:09:37
Thanks a lot ... its working now..
Shabs
2010-03-06 10:55:12
+2
A:
QCoreApplication inherits QObject, so you can call QCoreApplication::installEventFilter(QObject*). For further reference about event filters, see here.
erelender
2010-03-05 12:07:02
With this implementation I am facing a problem... I want to just monitor all Mouseclicks, but if a subclass handling 'MouseClick' then that event message is not handled in eventFilter(). Can you help me to understand this functionality.Thanks for the help.
Shabs
2010-03-06 09:09:27