[PyQt] RuntimeError: super-class __init__() of type WbGitMainWindow was never called?

Barry Scott barry at barrys-emacs.org
Tue May 31 11:13:45 BST 2016


> On 31 May 2016, at 10:47, Florian Bruhin <me at the-compiler.org> wrote:
> 
> * Barry Scott <barry at barrys-emacs.org> [2016-05-31 10:40:19 +0100]:
>> Here is a simplified example that shows a bizare error.
>> I am on Fedora 23 with python 3.4.3 PyQt 5.5.1 Qt 5.6 as packaged by Fedora.
>> 
>> $ cat qqq.py
>> from PyQt5 import QtWidgets
>> 
>> import sys
>> 
>> qapp = QtWidgets.QApplication( sys.argv )
>> 
>> class WbMainWindow(QtWidgets.QMainWindow):
>>    def __init__( self ):
>>        print( 'WbMainWindow.__init__' )
>>        super().__init__( self )
> 
> Here you're passing self as a parent argument to QMainWindow.__init__,
> so you're trying to set the not yet fully-initialized object as a
> parent of itself.
> 
> You probably want either "super().__init__()" or
> "QtWidgets.QMainWindow.__init__(self)" here.

Doh! Thank you.

Barry



More information about the PyQt mailing list