It\'s not the first time I am getting the RuntimeError: underlying C/C++ object has been deleted
. I\'ve solved it many times altering my code in a random but in
As of Python 3+ you can simplify the code even further.
from PyQt4.QtCore import *
class SomeTableModel(QAbstractTableModel):
def __init__(self, filename):
super().__init__() # No longer need to specify class name, or self
Super also grants some extra safeguards mentioned here: Understanding Python super() with __init__() methods