Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OS state (sleep or awake) in c++ Qt5.15.8
Forum Updated to NodeBB v4.3 + New Features

OS state (sleep or awake) in c++ Qt5.15.8

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 299 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anila
    wrote on last edited by
    #1

    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.

    SGaistS Pl45m4P 2 Replies Last reply
    0
    • A Anila

      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.

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • A Anila

        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.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #3

        @Anila

        If you are on Windows and need this for Windows only, have a look here:

        • https://forum.qt.io/topic/69485/do-an-operation-when-computer-goes-to-sleep

        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


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved