PDA

View Full Version : Any trick to have 'subwindows' without loosing the main window focus ?



tonnot
12th December 2011, 10:25
Maybe it is impossible...
I have a ms windows main window and I want to have sub windows or subpanels with free screen movement. I can use dialog and Qt::splashscreen flag, but when I am on these sub's I lose the focus caption for the main window. Is there any trick to do what I want ?
Thanks

ChrisW67
13th December 2011, 00:35
What do you mean by "when I am on these subs" if you do not mean the subwindow has focus?

tonnot
13th December 2011, 07:10
Theese subwindows have not 'window' title caption, so they have the focus but it is not 'visual' focus (that is , if there is not tittle caption, you dont see the 'traditional' focus by the color change of the title caption).
I can not think of any other 'trick' that having a custom main window without window title bar, building my own title and change the color of title bar manually when the app receives the focus.
In example, dreamweaver for windows has not 'windows' title bar.
What do you think about ?

Spitfire
13th December 2011, 10:13
Is, by any chance, MDI (http://doc.qt.nokia.com/latest/mainwindows-mdi.html) what you want?
You could easily customize child windows and this way your parent never looses focus.

Unless I misunderstood you.

tonnot
13th December 2011, 18:27
Thanks Spitfire.
I forgot to say that I want something like MDI but outside the mainwindow. (The Mdi let you having subwindows but always inside your main mdi window... )
Thanks anyway

ChrisW67
14th December 2011, 01:55
So your complaint is that when your main program opens the secondary windows they automatically activate and take focus from the main window. Try:


setAttribute(Qt::WA_ShowWithoutActivating);

in the secondary window constructor.