implement icons

This commit is contained in:
Kilian Valkhof 2010-02-03 19:11:06 +01:00
parent 18a07dda6c
commit f3bf6f2b21
2 changed files with 3 additions and 3 deletions

View file

@ -203,7 +203,7 @@ class TriTableModel(QAbstractTableModel):
def __init__(self, parent, imagelist, header, *args):
"""
mydata is list of tuples
imagelist is list of tuples
header is list of strings
tuple length has to match header length
"""
@ -223,13 +223,13 @@ class TriTableModel(QAbstractTableModel):
"""Get data."""
if not index.isValid():
return QVariant()
elif role != Qt.DisplayRole:
elif role != Qt.DisplayRole and role != Qt.DecorationRole:
return QVariant()
return QVariant(self.imagelist[index.row()][index.column()])
def headerData(self, col, orientation, role):
"""Get header data."""
if orientation == Qt.Horizontal and role == Qt.DisplayRole:
if orientation == Qt.Horizontal and (role == Qt.DisplayRole or role == Qt.DecorationRole):
return QVariant(self.header[col])
return QVariant()