Register user inactivity in qml



  • Is there a way to register if the user is inactive?
    I need to logout the user if he's inactive for 5 minutes.
    Does Qt provide an easy solution for this or do I have to set up a timer on my own?


  • Moderators

    @dauuser
    you could install an event filter on the QApplication instance and restart your timer on every mouse and key event (maybe also touch events). You might also listen to QEvent::ApplicationActivate/QEvent::ApplicationDeactivate events, but i don't know if they are also triggered on mobile platforms?

    qApp->installEventFilter(...);
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.