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. Detecting system resume event after suspend
Forum Update on Monday, May 27th 2025

Detecting system resume event after suspend

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 2.5k Views
  • 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.
  • TalklessT Offline
    TalklessT Offline
    Talkless
    wrote on last edited by
    #1

    Hi,

    Is there a Qt-way to detect if application is now working again because system was resumed after suspend?

    QGuiApplication::applicationStateChanged notifies when you when simply activating window, so this does not help.

    QSessionManager-related functionality only handles session saving before closing user session, if I understand correctly.

    Since my use case currently targets only Windows, I guess I'll have to "simply" catch
    PBT_APMRESUMEAUTOMATIC
    Windows native event with QCoreApplication::installNativeEventFilter, but I still hope that I missed something in Qt for this purpose...

    Any ideas?

    Thanks!

    1 Reply Last reply
    0
    • TalklessT Offline
      TalklessT Offline
      Talkless
      wrote on last edited by
      #7

      I have not found any alternatives, but to use QCoreApplication::installNativeEventFilter().

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

      1 Reply Last reply
      2
      • O Offline
        O Offline
        ofmrew
        wrote on last edited by
        #2

        How did you get this to post? Every post I tried I get "Title must be longer than 3 characters" but there is no place to enter a title and no instructions. Sorry for barging in but, I am frustrated!!!!!!

        K 1 Reply Last reply
        0
        • TalklessT Offline
          TalklessT Offline
          Talkless
          wrote on last edited by
          #3

          There is "Enter your title here" just above composing text box, above tool buttons. It is not visible as edit line, you just click on that text to start writing title.

          You should take screenshot and send bug report to Qt Website project (I guess) if you feel like it's something wrong.

          1 Reply Last reply
          0
          • O ofmrew

            How did you get this to post? Every post I tried I get "Title must be longer than 3 characters" but there is no place to enter a title and no instructions. Sorry for barging in but, I am frustrated!!!!!!

            K Offline
            K Offline
            koahnig
            wrote on last edited by mrjj
            #4

            @ofmrew

            Hi and welcome to devnet forum

            You go to the forum you like place your post. Press "New topic". As already described by @Talkless there is a place for a title line, but you need also add some more descriptions in the text box below of the menu line (B, I. andn a couple of symbols).

            [Pic added:Mrjj]
            alt text

            Vote the answer(s) that helped you to solve your issue(s)

            O 1 Reply Last reply
            0
            • K koahnig

              @ofmrew

              Hi and welcome to devnet forum

              You go to the forum you like place your post. Press "New topic". As already described by @Talkless there is a place for a title line, but you need also add some more descriptions in the text box below of the menu line (B, I. andn a couple of symbols).

              [Pic added:Mrjj]
              alt text

              O Offline
              O Offline
              ofmrew
              wrote on last edited by
              #5

              @koahnig I want to thank you and Talkless for your help. I was able to post my question, but I am still mystified because what was presented today was not what I saw yesterday. I just had one window that had Enter tag at the bottom and a Ask a question button, there was no place to enter a title. I was as if only half of the window sequence was presented. No matter what I did I could not get past the Tags mus have more than three characters. I do not know if this contributed to the problem, but after I posted the message out of frustration, I tried to see if I got any response and the system was down due to an overload. Strange. It works now and it has the behavior I expected to see in the first place. You can mark this as resolved, but not the UHD monitor problem.

              K 1 Reply Last reply
              0
              • O ofmrew

                @koahnig I want to thank you and Talkless for your help. I was able to post my question, but I am still mystified because what was presented today was not what I saw yesterday. I just had one window that had Enter tag at the bottom and a Ask a question button, there was no place to enter a title. I was as if only half of the window sequence was presented. No matter what I did I could not get past the Tags mus have more than three characters. I do not know if this contributed to the problem, but after I posted the message out of frustration, I tried to see if I got any response and the system was down due to an overload. Strange. It works now and it has the behavior I expected to see in the first place. You can mark this as resolved, but not the UHD monitor problem.

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #6

                @ofmrew

                It is hard to say what the potential cause of your problems where.

                The only thing I have noticed is that I have trouble with posting in the forum when I have accessed some special webpages which are not cooperating with my browser (Chrome). I merely need to restart Chrome and the forum does work again. However, it fails also in replying to a post then.

                In case you can replicate and describe the problem properly, you can file a bug report on JIRA.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • TalklessT Offline
                  TalklessT Offline
                  Talkless
                  wrote on last edited by
                  #7

                  I have not found any alternatives, but to use QCoreApplication::installNativeEventFilter().

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

                  1 Reply Last reply
                  2

                  • Login

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