PDA

View Full Version : How to bring child Qt::Tool windows back on top after main window gets focus again



cboles
27th July 2006, 18:48
Here is my situation: I have a main window that spawns many child Qt:Tool type widgets windows that work nicely until they are covered by other applications, or the main window is minimized. Once I restore the main window or give it focus, I would like these child windows to be visible (on top) again, but instead the remain buried under windows of other applications. Is there a simple way to manage this an keep their original stacking order?

jpn
27th July 2006, 22:13
One easy solution could be to put your widgets (which are currently set as tool windows) inside a QDialog and set it as a tool window.

Chicken Blood Machine
28th July 2006, 18:13
Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?

cboles
29th July 2006, 21:43
That flag doesn't do what I want. If you use that, your tool windows always stay on top, even when your main application window is minimized. I want my tool windows to appear and dissapear when my main window does, and not show as seperate windows on the taskbar either.


Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?

cboles
29th July 2006, 21:56
The tool windows aren't really tool windows in the classic sense. They can be quite large, and you might have 20 or more of them open at once. I wanted to do a frameless layout where these windows can be floating anywhere on the desktop (see below), but are still linked to the main application window in tems of minimize/restore. I believe Adobe Photoshop and similar programs have the same type of behavior with their tool windows.


One easy solution could be to put your widgets (which are currently set as tool windows) inside a QDialog and set it as a tool window.

http://www.openecu.org/images/5/50/EcuFlash_Screenshot.png

cboles
4th August 2006, 23:44
Update: I solved the problem.

I had changed some other code which was making these tool windows have a NULL parent. This is what was causing the strange decoupled behavior.

Colby