How to bring child Qt::Tool windows back on top after main window gets focus again
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?
Re: How to bring child Qt::Tool windows back on top after main window gets focus agai
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.
Re: How to bring child Qt::Tool windows back on top after main window gets focus agai
Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?
Re: How to bring child Qt::Tool windows back on top after main window gets focus agai
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.
Quote:
Originally Posted by Chicken Blood Machine
Did you use the Qt::WindowStaysOnTopHint flag when constructing the tool windows?
Re: How to bring child Qt::Tool windows back on top after main window gets focus agai
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.
Quote:
Originally Posted by jpn
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/E...Screenshot.png
Re: How to bring child Qt::Tool windows back on top after main window gets focus agai
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