Details
Description
I tried left, right, double, middle, but the terminal output was only reason = 3 or reason = 4,not found reason = 1 or reason = 2
connect(sysTray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(system_tray_clicked(QSystemTrayIcon::ActivationReason))); void MainWindow::system_tray_clicked(QSystemTrayIcon::ActivationReason reason) { qDebug() << "reason = " << reason << endl; switch (reason) { case QSystemTrayIcon::Trigger: case QSystemTrayIcon::DoubleClick: if ( this->isHidden() || this->windowState() == Qt::WindowMinimized) { if (this->windowState() == Qt::WindowMinimized) this->hide(); this->showNormal(); } else { this->hide(); } break; default: break; } }