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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before After
Before After

View file

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