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. Catching system shutdown
Qt 6.11 is out! See what's new in the release blog

Catching system shutdown

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.6k Views 1 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.
  • J Offline
    J Offline
    jdarnold
    wrote on last edited by
    #1

    Our app puts up a warning dialog when you close the main window, telling the user it is minimizing to the system tray. But I don't want to do this if the window is getting closed because the system is being shutdown. How can I catch the shutdown and not put up the warning? Unfortunately, there doesn't seem to be a system shutdown signal. I looked at QSession, but nothing jumps out.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dangelog
      wrote on last edited by
      #2

      If the user is closing the session, you should be able to do what's described in here.

      http://doc.qt.nokia.com/4.7/session.html

      Software Engineer
      KDAB (UK) Ltd., a KDAB Group company

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jdarnold
        wrote on last edited by
        #3

        Yeah, I ended up creating a QApplication-derived class and setting a flag in commitData. It seems an odd way to do something so basic as catch system shutdown, but if it works..,

        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