mirror of
https://github.com/Kilian/Trimage.git
synced 2026-01-26 10:08:40 -05:00
implement icons
This commit is contained in:
parent
18a07dda6c
commit
f3bf6f2b21
2 changed files with 3 additions and 3 deletions
BIN
trimage-icon.png
BIN
trimage-icon.png
Binary file not shown.
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue