[PyQt] newbie question on getting widget handles

Baz Walter bazwal at ftml.net
Wed Jun 9 19:58:59 BST 2010


On 08/06/10 18:21, Danny wrote:
> So how do I get a handle to the main window from a child MDI window?

in previous versions of qt, you could have used qApp.mainWidget() but 
that has been removed in qt4. so you either have to keep a reference to 
the main window yourself, or use the qwidget hierarchy to access the 
relevant parent widget. presumably, you set the mdi area as the central 
widget of the main window. so an mdi child window could get the main 
window via child.mdiArea().parentWidget().



More information about the PyQt mailing list