[Solved] global eventfilter?! is it possible?
-
wrote on 9 May 2012, 10:01 last edited by
Hello,
I have some pages (QWidgets) and a user system.
I want to reset the userlevel after a timespan without any mouse events.
But how can I do that? Do I have to make an eventfilter in every widget
or is there a better way? -
wrote on 9 May 2012, 10:24 last edited by
You could install an event filter on the QApplication object instead. Note that this will only catch events for your application. If the user is working with another application in the meantime, this method will not catch that.
-
wrote on 9 May 2012, 10:52 last edited by
thank you for your help, it's working now.
But could this be a performance leak? i catch every
event and only if it's a mousepressevent, I do something,
otherwise I send it back with return QObject::eventFilter(object,event); -
wrote on 9 May 2012, 11:29 last edited by
Without seeing your code, I cannot say for sure if you're leaking memory, but I don't think so. Note that you should probably not really handle any event you receive. You only want to know about the events, but you don't want to process them.
-
wrote on 9 May 2012, 13:31 last edited by
thx
2/5