July 31, 2011

umen242 umen242
Ant Farmer
328 posts

How to catch QSystemTrayIcon quit event

 

I have QSystemTrayIcon subclass , inside i have

  1. quitAction = new QAction(tr("&Quit;"), m_parent);
  2. 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 .

3 replies

July 31, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

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

July 31, 2011

umen242 umen242
Ant Farmer
328 posts

what about aboutToQuit()?

July 31, 2011

Denis Kormalev Denis Kormalev
Lab Rat
1654 posts

yep, should also help you

 
  ‹‹ QTcpServer - Fortune example problem      library’s name ››

You must log in to post a reply. Not a member yet? Register here!