Qt World Summit: Submit your Presentation

TypeError: __init__() takes at least 2 arguments (2 given)

  • Developing a python plugin on QGIS, I get this error : TypeError: init() takes at least 2 arguments (2 given)

    Here is my code :

    if self.checked_list != [] :
           dialog = LaunchTRANUSDialog(self.checked_list,parent=self)
           result = dialog.exec_()
    class LaunchTRANUSDialog(QtGui.QDialog, FORM_CLASS):
    def __init__(self,checked_list,parent=None):
       super(LaunchTRANUSDialog, self).__init__(parent)
       self.checked_list = checked_list
       self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget')

    Could you help me please ? Thank you

  • Qt Champions 2017

    But your a init call shows only one parameter ?

  • Sorry, but I don't understand your answer . Could you explain more ?

  • Hello,

    It was an other problem that causes this problem. So, I solved and now it works.

    Thanks .

Log in to reply