Hi All,

Recently i started to program Qt on OS X.
My simple application is composed by only one window with a system tray icon.
When the user press the closing button (x) on the top left corner, the application becomes hide.
I also connect an action from the tray icon menu to quit the application. Everything works fine with the expected behavior.

My only problem is that, the app also have the icon dock menu with the action "quit". This action is a native function provided by the OS.
What i would like to do is to "catch" this signal emit from that action.
Because seems that the quit from the dock icon is different from the CMD+Q action(i'm able to manage this signal in my overloaded function).
Qt Code:
  1. void MainWindow::closeEvent(QCloseEvent* event)
To copy to clipboard, switch view to plain text mode 
The quit from the Dock Menu seems like an interrupt(like SIGTERM) and the app quit in any case. If the application main window is shown, i don't want to close the app but simply hide the window.

Another weird thing is that when i press on quit from the Dock menu, the
Qt Code:
  1. closeEvent(QCloseEvent* event)
To copy to clipboard, switch view to plain text mode 
function is called twice and if i ignore the close event
Qt Code:
  1. event->ignore()
To copy to clipboard, switch view to plain text mode 
the app quit anyway.

Thanks to All in advance.