OS state (sleep or awake) in c++ Qt5.15.8
-
Is there a way to know if the host machine is awake or asleep in Qt5.15.8.
I want to know if there is a qt function that determines when hosting OS goes to sleep and
when the hosting OS awakens.Hi and welcome to devnet,
No there is not. You need to listen to the corresponding native events using a native event filter and act accordingly.
-
Is there a way to know if the host machine is awake or asleep in Qt5.15.8.
I want to know if there is a qt function that determines when hosting OS goes to sleep and
when the hosting OS awakens.If you are on Windows and need this for Windows only, have a look here:
As @SGaist said, there is no platform independent "Qt way". You have to do this for every OS separately, if you are planning to go multi-platform