I have a QAbstractTableModel and use QML’s TableView to display it.
Roles are used to determine the column to display.
itemDelegate is used for the TableView cells
Depending on the information in table, for some cells a icon has to display beside the text.
What is a approach to transfer:
a text from the data model
a status value from the data model
My first approaches were:
return value like: “Text:\“text to display\“Icon:TheImage.png” —> requires text parsing in qml file
overlay two TableViews: one for text, one for icons —> both icons’s size and text size does not influence each other
So I dismiss these.
↧