[PyQt] RuntimeError: super-class __init__() of type WbGitMainWindow was never called?
Florian Bruhin
me at the-compiler.org
Tue May 31 10:47:40 BST 2016
* 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.
Florian
--
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160531/e212b4bf/attachment.sig>
More information about the PyQt
mailing list