PDA

View Full Version : How to prevent a popup dialog gaining focus



chris_helloworld
14th December 2010, 13:18
Hi all,
Is there a way to prevent a non-modal dialog gaining focus / becoming active when it is shown ?

Cheers,
Chris.

nikhilqt
14th December 2010, 13:31
Does this help http://doc.trolltech.com/4.6//qwidget.html#setFocus

chris_helloworld
14th December 2010, 13:47
Hi,
Thanks for your suggestion. I have tried calling setFocus after showing my dialog on the widget that originally had focus, however it does not regain the focus.

Having said that, ideally, I really dont want the widget to loose focus at all - I simply want the dialog to be displayed but not gain focus or become active.

Added after 9 minutes:

I seem to get the desired effect by calling activateWindow on the original widget after showing my dialog :)