sashoalm
sashoalm

Reputation: 79685

System tray icon doesn't show in Qt5 (Linux/LXDE)

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.

Upvotes: 2

Views: 1651

Answers (1)

Arenim
Arenim

Reputation: 4247

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.

Upvotes: 2

Related Questions