Apr-18-2020, 05:39 PM
You need to call __init__ for the Stopwatch superclass before you start adding buttons. Calling super().__init__(), super(Stopwatch, this).__init__() or QWidget.__init__(this) teaches class Stopwatch how to do QWidget things. Stopwatch by itself does not know how to be the parent for start_button. That is why you got your error. If you moved the super __init__ to where it belongs (at or near the top of the __init__ method) your program should work.