Check the System Tray Icon Example. It catches close event and hides the window instead of closing it:
Qt Code:
  1. void Window::closeEvent(QCloseEvent *event)
  2. {
  3. if (trayIcon->isVisible()) {
  4. ...
  5. hide();
  6. event->ignore();
  7. }
  8. }
To copy to clipboard, switch view to plain text mode