Hi,
Is there a way to know if a window is on top of all the others?
I don't meant to set the flag Qt::WindowStaysOnTopHint but just to know if the window is on top of all the others?
Hi,
Is there a way to know if a window is on top of all the others?
I don't meant to set the flag Qt::WindowStaysOnTopHint but just to know if the window is on top of all the others?
sorry, stupid question, IsActiveWindow could work.
bye
Actually, this is not a stupid question at all. Say you *do* have some windows that are always on top, and some that are not. The question of where a window is in Z-plane (stacking) order is different from whether the window is active (where user input is going) or not.
Now, if you were looking for the active window, then you did answer your own question. If you're talking about which windows are above / below in stacking order... I've found Qt lacking in providing that information, and have resulted to OS-specific mechanisms in most cases.
Furthermore some window managers don't raise active windows, so even if you don't have any windows with a "stays on top" hint, it doesn't yet mean the active window is the one on top.
Thanks for answering, so what do you suggest to do if I want to raise the window of my QT app when it's under some other dialogs?
I'm using Windows XP
bye
thanks, I meant when other dialogs are not in my app but regular dialogs from other softwares. Is there a put on top (like hint Qt::WindowStaysOnTopHint) but then after putting it on top return to a "normal" state where others can then overlap?
thanks
bye
To do this, you can try QWidget::raise() as jpn suggested, but it may not work. You can look here for some information about how this used to work. There are ways to accomplish what you want that are Windows-specific code. Searching MSDN for SetForegroundWindow will get you some of what you need. With a solid understanding of how Windows input processing works, you can find other ways to subvert what the OS is doing to prevent apps from jumping in front of each other, too.
Hope this helps.
"I've found Qt lacking in providing that information, and have resulted to OS-specific mechanisms in most cases."
- Eldritch
I really would like to see a working example for this problem (I also asked it in this thread)
SetForegroundWindow seems like a mess on different Windows versions.
On Macintosh, this problem does not exist.
Bookmarks