[PyQt] can't get findChild to work
shevitz at lanl.gov
Tue Jun 8 23:29:53 BST 2010
Another newbie question here. I am trying to get findChild to work. The code
I am trying is
print "in ElicitorPage, mdiArea = ", mdiArea
As can be seen, I am getting the global application object, then printing
all of its widgets (it is an MDI application with
a QMdiArea widget as the central widget). Then I try to find the QMdiArea
widget. I don't believe I need a name in findChild
since the defaults to "" which matches all instances. I also tried with a
name, and it didn't work for me anyway. In any case, here is the output
of the code:
[<PyQt4.QtGui.QMenu object at 0x013F4108>, <PyQt4.QtGui.QMenu object at
<PyQt4.QtGui.QMdiArea object at 0x013D1AE0>]
in ElicitorPage, mdiArea = None
As you can see, there is clearly a QMdiArea widget in app.allWidgets, and
yet the findChild method doesn't return it.
Can anyone tell me what I am doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt