Shabs
Shabs

Reputation: 31

Using QCoreApplication::setEventFilter() in qt

I want to catch all events for the application. How can i use this method to achive this? Please help me !!

Upvotes: 3

Views: 3560

Answers (2)

zweihander
zweihander

Reputation: 6295

QCoreApplication inherits QObject, so you can call QCoreApplication::installEventFilter(QObject*). For further reference about event filters, see here.

Upvotes: 2

Mathias Soeken
Mathias Soeken

Reputation: 1303

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 );

Upvotes: 1

Related Questions