I am trying to display a list that I am creating using PySide. This is not just a list of strings (or I could use a QListWidget ), but I simplified it for an example.
from PySide import QtCore, QtGui class SimpleList(QtCore.QAbstractListModel): def __init__(self, contents): super(SimpleList, self).__init__() self.contents = contents def rowCount(self, parent): return len(self.contents) def data(self, index, role): return str(self.contents[index.row()]) app = QtGui.QApplication([]) contents = SimpleList(["A", "B", "C"])
I see nothing , just an empty list.
What am I doing wrong?
source share