[PyQt] reference to container widget

Mario Daniel Carugno carugnom at gmail.com
Wed Mar 18 19:58:55 GMT 2009


Hi, given this code:


...
child = Form()
app = Framework(child)
...

Ok, Form is a grid of data, and Framework includes it with addWidget.

class Framework:
   def __init__(self, child):
      ...
      self.layout.addWidget(child)

Now, can i reference a Framework's widget from a Form's instance ?
To the Form, Framework is not a parent. But it's a container.
Suppose that Framework has a widget named 'labelModuleName', how
can i write in that widget, but from the Form class ?
This is the imaginay pseudocode:

class Form:
   def __init__(self):
      self.CONTAINER.labelModuleName.setText("Form Module")


More information about the PyQt mailing list