Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. TypeError: __init__() takes at least 2 arguments (2 given)
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Solved Language Bindings
python
4 Posts 2 Posters 4.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by A Former User
    #1

    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)
           dialog.show()
           result = dialog.exec_()
           self.reinitialise_checked_list()
    
    
    class LaunchTRANUSDialog(QtGui.QDialog, FORM_CLASS):
    
    def __init__(self,checked_list,parent=None):
       """Constructor."""
       super(LaunchTRANUSDialog, self).__init__(parent)
    
       self.setupUi(self)
       self.checked_list = checked_list
    
       self.tabs = self.findChild(QtGui.QTabWidget, 'tabWidget')
    

    Could you help me please ? Thank you

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by dheerendra
      #2

      But your a init call shows only one parameter ?

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Hello,

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

          Thanks .

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved