On Monday 05 November 2007, Vladimir Pouzanov wrote:
> Hi all,
>
> I'm trying to implement a table model:
> class AModel(QtCore.QAbstractTableModel):
> def __init__(self, parent=None):
> QtCore.QAbstractTableModel.__init__(self, parent)
>
> def rowCount(self, parent=QtCore.QModelIndex()):
> print "row count rq"
> return 3
>
> def columnCount(self, parent=QtCore.QModelIndex()):
> print "col count rq"
> return 3
>
> def data(self, idx, role=QT.DisplayRole):
> print "data rq"
> return QtCore.QVariant("test")
>
> ...
>
> self.ui.tableView.setModel(AModel())
>
> the problem is that data is never called (rowCount/columnCount are called
> three times each), so nothing is rendered. What do I mess?
Your model is being immediately garbage collected.
Phil
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt