You don't need to worry about the abstract model just to get data into a table. I believe it's simplest form is just creating a table item and inserting it in the table. For a string (using unicode):
> item = QtGui.QTableWidgetItem( unicode(data)) > table.setItem(rowCount, colCount, item ) > For data: > item= QtGui.QTableWidgetItem( 0 ) item.setData( 0, QtCore.QVariant( data ) table.setItem(rowCount, colCount, item ) I'm new to this myself, but this is the way that I have it working. On Tue, Feb 10, 2009 at 1:07 PM, Brian Makin <[email protected]> wrote: > I need to create a table with string and number fields. I'm having a bit > of problem getting this to work. What is the correct way to do this? > > It doesn't look like TableModel handles numbers so do I need to subclass > abstract table model et al? > > Are there any handy examples of this (including sorting of the columns)? > > _______________________________________________ > PyQt mailing list [email protected] > http://www.riverbankcomputing.com/mailman/listinfo/pyqt >
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
