All pastes #406268 Raw Edit

Coke

public python v1 · immutable
·published 2007-03-22 08:38 UTC
rendered paste body
    def data(self, index, role = QtCore.Qt.DisplayRole):        if (not index.isValid()            and index.row() >= len(self._order.rows)            and index.column() >= 0 and index.column < self.columnCount()            and role == QtCore.Qt.DisplayRole):            return QVariant("%d/%d"%(index.column(), index.row()))        return QVariant("error")    def headerData(self, section, orientation, role = QtCore.Qt.DisplayRole):        if role == QtCore.Qt.DisplayRole:                        if orientation == QtCore.Qt.Horizontal:                return QtCore.QVariant(self._columnTitles[section])            else:                return QtCore.QVariant("Row %d"%section)        return QtCore.QVariant()