Python Forum
Converting c++ class to python class
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting c++ class to python class
#3
I used your code, slightly modified (line 5, 'parent=None' and line 10, 'pass'):
from PyQt4.QtCore import QObject
from PyQt4.QtGui import QAbstractProxyModel

class EPNCComboModel(QObject) :
  def __init__(self, parent=None):
      def __init__(parent):
          self.parent = parent

  def QAbstractProxyModel(self, EPNCComboModel):
      pass
      # when used here, self.parent will reference the instance in __init__
Now I get the error: "RuntimeError: super-class __init__() of type EPNCComboModel was never called"

I suppose I must use something like: super(EPNCComboModel, self).__init__(parent) ?
Reply


Messages In This Thread
Converting c++ class to python class - by panoss - Jul-16-2017, 10:20 AM
RE: Converting c++ class to python class - by panoss - Jul-17-2017, 11:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  class Blockage not projecting Azdaghost 1 497 May-15-2025, 04:32 PM
Last Post: deanhystad
  Return a string or byte object from Enum class? Calab 5 822 May-14-2025, 05:21 PM
Last Post: snippsat
  Python inner classes inheritance from parent class Abedin 8 1,392 Apr-23-2025, 05:56 AM
Last Post: Gribouillis
  Accessing method attributes of python class Abedin 6 1,422 Apr-14-2025, 07:02 AM
Last Post: buran
  Python class members based on a type value voidtrance 7 1,569 Apr-11-2025, 10:10 PM
Last Post: deanhystad
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,697 Mar-25-2025, 06:37 PM
Last Post: voidtrance
  printing/out put issue with class arabuamir 3 1,176 Aug-25-2024, 09:29 AM
Last Post: arabuamir
  Class test : good way to split methods into several files paul18fr 5 4,317 Jul-17-2024, 11:12 AM
Last Post: felixandrea
  [split] Class and methods ebn852_pan 15 3,773 May-23-2024, 11:57 PM
Last Post: ebn852_pan
  [SOLVED] [listbox] Feed it with dict passed to class? Winfried 3 1,449 May-13-2024, 05:57 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020