Understanding MVC in a QAbstractTableModel
问题 I have some data which are represented by a class of my own ; to fix the ideas I give an example. class MyOwnModel(): def __init__(self, name="", number=0): self.name = name self.number = number I then have a list of such instances, that I want to represent in a QTableView . li = [MyOwnModel("a", 1), MyOwnModel("b", 2)] Then I see two strategies to make a QTableView from that : change MyOwnModel so that it subclasses QAbstractTableModel build a new QAbstractTableModel which mimics MyOwnModel