Using QCoreApplication :: setEventFilter () in qt

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

+3
source share
2 answers

QCoreApplication inherits QObject, so you can call QCoreApplication :: installEventFilter (QObject *). Read more about event filters here .

+2
source

You must implement and provide a function and point to it.

For instance:

bool myEventFilter(void *message, long *result)
{
  // do something with message and result
}

And name it as follows:

app->setEventFilter( myEventFilter );
+1
source

Source: https://habr.com/ru/post/1735584/


All Articles