开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜