Using QCoreApplication::setEventFilter() in qt
I want to catch all events for the application. How can i use this method to ach开发者_JS百科ive this? Please help me !!
QCoreApplication inherits QObject, so you can call QCoreApplication::installEventFilter(QObject*). For further reference about event filters, see here.
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 );
精彩评论