How to use libpsi Idle class



  • Would anyone have a working example of how to use the Idle class that comes in libpsi on Ubuntu 16.04?
    I am looking to see how to detect idle time on the host so I can trigger a 'screen saver' after a certain amount of idle time. Another question about the Idle class is; does it rely on having the screen turned off? (No point showing a screen saver if the screen is off.)


  • Qt Champions 2016

    Hi
    Do you mean this class
    https://github.com/psi-im/libpsi/blob/master/tools/idle/idle.h

    It seems to check if cursor have been moved.

    To use it, include the file ( or use the .pri file) and hook up signal
    void secondsIdle(int);
    to your own slot
    then call start on the object.
    (did not try but seems very straightforward)


Log in to reply
 

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