Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt tray icon window

Tags:

qt

I am using QT.QSystemTrayIcon to create a tray icon.

When clicking on a tray icon, I need a window to opens right above the icon (in the bottom right corner). How can I do this?

like image 374
nish Avatar asked Jan 28 '26 13:01

nish


1 Answers

If you want to open the window aligned with the icon (as the built-in volume control does), take a look at the manual for this:

QRect QSystemTrayIcon::geometry()

Ok, I'm answering 4 years later, because I found this question today, trying to solve the same problem.

Note: This is working well on Win, tested on XP, 7 and 8 but, as pointed by @MichaelScheper, this isn't working on Mint/GNOME. Feedback on other platforms is welcome.

like image 178
Bacco Avatar answered Feb 01 '26 02:02

Bacco