Hello Marcus, Thank you for the speedy response it worked like an absolute charm!
Cheers, Ben On Thursday, 5 March 2015 09:29:23 UTC+1, Marcus Ottosson wrote: > > 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/913172b1-fdf1-4d4a-972e-c0af5d3e60f0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
