I'm porting an application from Qt4 to Qt5, and it shows a system tray icon. In Qt4 it works, but when compiling with Qt5, the icon isn't shown.

The code I use to show the icon is:

QSystemTrayIcon* trayIcon = new QSystemTrayIcon(this);
trayIcon->setIcon(qApp->windowIcon());
trayIcon->setVisible(true);

My computer runs LXDE on Debian Wheezy.

share|improve this question
up vote 2 down vote accepted

It's OK (I mean with Your code).

For now, QT5 have a lot of unresolved problems with tray icon for linux.

Here some bugs for futher reading:

https://bugreports.qt.io/browse/QTBUG-30079

https://bugreports.qt.io/browse/QTBUG-31762

https://bugreports.qt.io/browse/QTBUG-34364

Unfortunately, there is a little we can do. I re-written my app to make all options be accessible without tray.

P.S. there are some workarounds in bugs I've posted, and they SOMETIMES work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.