2

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.

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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