QSystemTrayIcon disappears on UBuntu 20.04/22.04 after reboot
Unsolved
General and Desktop
-
My Qt Application shows the QSystemTrayIcon on fresh install but after reboot or logout/login I see the QSystemTrayIcon disappears from UI on startup.
I am seeing this issue on 20.04 and 22.04. 18.04 works no issues.
Here's my implementation. This function is called on initialization:
// Create tray and setup tray icon void MyApp::createTrayIcon() { QString trayImgStr = TRAY_IMG; m_pTrayIconMenu = new QMenu(this); m_pTrayImage = new QPixmap(trayImgStr); m_pTrayIcon = new QSystemTrayIcon(this); QIcon icon(*m_pTrayImage); m_pTrayIcon->setIcon(icon); setWindowIcon(icon); m_pTrayIcon->show(); connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(onActivated(QSystemTrayIcon::ActivationReason))); }
-
Hi,
Did you check that the pixmap is created successfully on these platform ?
On a side note, there's no need to created your QPixmap object on the heap.