I have two classes :
The first one (the parent class) instantiates the child class in a method.
I am trying to modify parent objects properties inside the child class. (These objects are PyQT QWidget
s).
Here is the begining of my Parent and Child classes :
Parent :
class ParentClass(QtGui.QMainWindow):
def __init__(self, parent=None):
super(ParentClass, self).__init__()
somevar=1200
self.ChildItem=ChildClass()
self.ChildItem.Start(somevar)
Child :
class ChildClass(QtGui.QWidget):
def Start(self, var):
super(ChildClass, self).__init__(self)
self.parent().resize(var,var)
However, even if I have no errors, the last line produces nothing.
I've seen on several examples that the super()
could be used to call parent methods, so I assume that it would be a solution for my case. However, I was unable to make it work either.
I have a lot of troubles understanding the super()
, it always get into complicated concepts such as multiple inheritance when I just want to do a simple thing.