PDA

View Full Version : How to ensure widget is visible



arturo182
31st August 2009, 14:07
Hello, I want to achieve something like this: I have a tray icon and when I click it I want it to toggle the visibility of my main window. That sounds easy to achieve, but there's one problem, when my window is behind another application's window it is still considered visible so clicking tray icon hides it and i have to double click to make it visible. This isn't a big deal but can be annoying, is there a function in Qt to know is a window covered by another window? Using QWidget::activeWindow() always returns false because when I click the tray icon the window looses focus and is not active.

wysota
31st August 2009, 19:52
There is no Qt way to do that.

arturo182
1st September 2009, 00:26
But I saw an application that could do this so maybe it can be achieved using WinAPI, I can use WinAPI in Qt, right? Of course it will only work on Windows.

wysota
1st September 2009, 00:45
Sure you can. I'm also sure there is an X11 equivalent.