[PyQt] Multiple Inheritance with PyQt5 on python 2

Sebastian Eckweiler sebastian.eckweiler at twt-gmbh.de
Fri Dec 9 12:22:06 GMT 2016


Hi there, 

I've just read through 
http://pyqt.sourceforge.net/Docs/PyQt5/multiinheritance.html.
I'm using a self-built PyQt5 for Python 2 on Windows - and it seems I 
can't get multiple inheritance to work:

class SomeClass(object):

    def __init__(self, attr):
        self.attr = attr

class AnotherDialog(QtWidgets.QDialog, SomeClass):

    def __init__(self, parent=None):
        #super(AnotherDialog, self).__init__(parent) # tested this was 
well
        QtWidgets.QDialog.__init__(self, parent)
        SomeClass.__init__(self, 1)


app = QtWidgets.QApplication([])
dlg = AnotherDialog()

This always results in 

TypeError: __init__() takes exactly 2 arguments (1 given)

is there a workaround for this?

Cheers,
Sebastian
-------------------------------------------------------
Dr. rer. nat. Sebastian Eckweiler
Senior Software Developer
Performance & Efficiency

TWT GmbH
Science & Innovation
Ernsthaldenstraße 17
D-70565 Stuttgart

Tel: +49.7 11.21 57 77.606
Mobil: +49.162 131.00.64

E-Mail: Sebastian.Eckweiler at twt-gmbh.de
---------------------------------------------------------
www.twt-gmbh.de
---------------------------------------------------------
Geschäftsführung: Dr. Dimitrios Vartziotis, Joachim Laicher (Stv.), Frank 
Beutenmüller (Stv.)
Registergericht: Amtsgericht Stuttgart, HRB Nr. 212778
Umsatzsteuer: ID-Nr.: DE147841145
---------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161209/776ceb2b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 12765 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20161209/776ceb2b/attachment.jpe>


More information about the PyQt mailing list