I have implemented tray icon menu for QT application. But the tray icon menu would not hide after clicking other places. Following is my code:
m_trayIconMenu = new QMenu(this);
m_trayIconMenu->addAction(m_restoreAction);
m_trayIconMenu->addAction(m_quitAction);
m_trayIcon = new QSystemTrayIcon(this);
m_trayIcon->setContextMenu(m_trayIconMenu);
Try to remove the this pointer as below.Tied you m_trayIconMenu to QSystemTrayIcon instead of parent this pointer.