MainwWindow::closeEvent(QCloseEvent * event){event->accept()if (!trayIcon->isVisible()) qApp->quit(); //ну или exitAction->trigger(), это по-вашему усмотрению :)}
void Window::closeEvent(QCloseEvent *event) { if (trayIcon->isVisible()) { QMessageBox::information(this, tr("Systray"), tr("The program will keep running in the " "system tray. To terminate the program, " "choose <b>Quit</b> in the context menu " "of the system tray entry.")); hide(); event->ignore(); } }