self.modelTree = self.uiMainWindow.uiModelTree # This is where I get the error
self is referring to your instance of ModelWindow, but you store
uiMainWindow in the instance of MainWindowSetup.
If you want to access that, you’ll need to pass a handle to it. It’s
typically done using a parent, but you aren’t including the parent in your
__init__ method.
Try something like this.
class MainWindowSetup(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.uiMainWindow = Ui_MainWindow()
self.uiMainWindow.setupUi(self)
self.uiModelWindow = ModelWindow(self)
class ModelWindow(QtGui.QTreeWidget):
def __init__(self, parent):
print "!! Initialised model window"
QtGui.QTreeWidget.__init__(self, parent)
self.modelTree = parent.uiMainWindow.uiModelTree # This is
where I get the error
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAFkRFznzJx3hV9A5_iTH9Mc8czcoDf5bHktiPm6xJNzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.