Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QSystemTrayIcon showMessage icon stays permanently (Ubuntu 18.04)



  • In my program , I am trying to change the system tray icon to something else (tempIcon) for 5 seconds using the following code:

    systemTrayIcon->showMessage(tr("title"), QString::fromStdString(msg), tempIcon, 5000);
    

    but the icon does not change back to the original icon ever.

    Am I doing something wrong here? Or is this a framwork problem in Qt?



  • Fixed the issue by creating another QSystemTrayIcon to show messages, and used systemTrayIcon->setIcon() method to change icon.


  • Moderators

    With this function, you are displaying a message, not changing the tray icon... however, the message icons tend not to work more often than they do.



  • Fixed the issue by creating another QSystemTrayIcon to show messages, and used systemTrayIcon->setIcon() method to change icon.


Log in to reply