How can I make my application appear in the system tray?

645 views Asked by At

How can I make my application appear in the system tray?

I already have a QDialog widget with parent as qApp->mainWidget() and disabled the task bar entry. Now I need it to appear in the system tray.

I am using Qt 3.3

1

There are 1 answers

1
Samuel Harmer On

I'll start by saying you're probably wasting your time. I can't seem to find anything in the Qt 3.3 documentation which alludes to what you want. However in Qt 4.8 there is a QSystemTrayIcon class, which was introduced in Qt 4.2.

Normally, when a new class replaces an old class the Qt documentation says so, therefore I doubt any code was written to handle system tray icons across the supported platforms in 3.3.

Furthermore, even if you do find something in 3.3, it's unlikely it will work now as most OSes are likely to have changed their GUIs since then.

My answer? Update to 4.8 and use QSystemTrayIcon.