PDA

View Full Version : Focus issues / Setting multiple focus



ComputerPhreak
16th February 2007, 01:24
Hi all,

This is my first post here, although I am a longtime Qt user. Anyway, I am looking to do two things: one, to have tool windows always have the focus (or always be drawn as if they have the focus), and to have both my main window and its sub-dialogs to share focus, ala Photoshop. On Windows, I want to have an MDI-style setup, although I am not using the Qt MDI classes. I would like all keyboard events to propagate from my dialogs (which display images) to the main window, which just has the menubar. On the mac, I want to have just a menubar and tool windows. Basically, I want to emulate the behavior of Photoshop.

I tried using setFocusProxy, but all the combinations of calls I made seemed to have no effect, I suspect I don't really understand the function.

Any help would be appriciated,

cp

rajesh
16th February 2007, 06:09
calling raise() will set the focus on widget.

You will have check the geometry(). If the geometry's x
and y coordinates are negative, the widget is not on focus.
If the coordinates are positive, the widget is on top .

I have implemneted these method on QDockWidget. it may help you.