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. How to catch QSystemTrayIcon quit event
Forum Updated to NodeBB v4.3 + New Features

How to catch QSystemTrayIcon quit event

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.3k 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.
  • U Offline
    U Offline
    umen242
    wrote on last edited by
    #1

    I have QSystemTrayIcon subclass , inside i have
    @quitAction = new QAction(tr("&Quit;"), m_parent);
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit())); @
    CloseEvent doesn't work here .. how can i catch this quit event ?
    i want to save data befor closing .

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

      You either can connect to QApplication::destroyed() or connect your quitAction to your slot which will save data and call qApp->quit().

      1 Reply Last reply
      0
      • U Offline
        U Offline
        umen242
        wrote on last edited by
        #3

        what about aboutToQuit()?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DenisKormalev
          wrote on last edited by
          #4

          yep, should also help you

          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