[PySide] Correction: TypeError setting multiple inheritance instance as QWidget parent

Aaron Richiger a.richi at bluewin.ch
Wed Oct 10 20:22:08 CEST 2012


Hello Owen!

The following code works great on my machine... It is basically your 
code with a main block to test it. Please try to execute it and if it is 
successful, try to find the difference with your non-working version. I 
guess, the difference will be in the main block?!?

Have a nice evening!
Aaron

########### Code ############

import sys
from PySide import QtGui


class Node(object):
     pass


class Foo(QtGui.QTabWidget, Node):

     def __init__(self):
         super(Foo, self).__init__(parent=None)
         Node.__init__(self, 'Node name is Disp')
         self.bar = Bar(self)


class Bar(QtGui.QDialog):

     def __init__(self, parent_widget):
         super(Bar, self).__init__(parent=parent_widget)


if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     w = Foo()
     w.show()
     sys.exit(app.exec_())



More information about the PySide mailing list