I wanted to convert this code snippet to PyQt5. I am running into an issue that I don't understand:
from PyQt5 import QtWidgets
import logging
class QPlainTextEditLogger(logging.Handler):
def __init__(self, parent):
super().__init__(parent)
class MyDialog(QtWidgets.QDialog, QPlainTextEditLogger):
def __init__(self, parent=None):
super().__init__() # <= Error here
if (__name__ == '__main__'):
app = None
if (not QtWidgets.QApplication.instance()):
app = QtWidgets.QApplication([])
dlg = MyDialog()
dlg.show()
dlg.raise_()
if (app):
app.exec_()
This produces the following error:
super().__init__(parent) TypeError: __init__() missing 1 required positional argument: 'parent'
Could someone help me?
Thanks!
Aucun commentaire:
Enregistrer un commentaire