[Qt-interest] adressing something to the mainWindow from a dialog

R. Reucher rene.reucher at batcom-it.net
Tue Apr 7 10:38:28 CEST 2009


On Tue April 7 2009 10:29:26 Tiago Correia wrote:
> You can access the main application by using the global variable qApp, then
> you can use activeWindow static method to get the active window.
Yeah, but this gives you a pointer to the currently _active_ QWidget (= the 
one that has input focus), which is not necessarily the same as the "main 
widget". And you'd still need to use a cast to your specific sub-class to 
access custom members in it... this will only be valid if your application 
has just ONE (and only ONE) top-level widget!!
-- 
René Reucher
rene.reucher at batcom-it.net
http://www.batcom-it.net/




More information about the Qt-interest-old mailing list