Placing a Qt4 widget on windows

How can I place a Qt4 widget just above the tray on Windows. Since the exact coordinates can depend on the resolution and even the size and placement of the taskbar (top or bottom of the screen, etc.)?

I think there is a way to get the screen resolution, but is there any method for getting the taskbar size and placement?

+2


source to share


2 answers


No no.

You can get the screen size with QDesktopWidget

- this will give you the number of screens, screen size, etc. However, finding the location of the taskbar and then in the system tray is platform dependent.



Why would you want to do that? Are you trying to imitate QSystemTrayIcon

? Perhaps if you tell us what you are trying to do, we can help you.

+1


source


Answering my own question, but apparently as of Qt 4.3 I can get the coordinates of the tray icon using the QSystemTrayIcon.geometry () method. So I can position my window relatively. It would be even better if I could get the position of the taskbar, but I guess I can think of something for it.



http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qsystemtrayicon.html#geometry

+1


source







All Articles