Aug-12-2023, 11:10 AM
I am struggling to figure out something. I have a
I posted this as a feeler. I'm about to continue making love to my IDE, but I'm not sure where to begin. The PyQt docs are what they are. I hope I'm making sense.
QTreeView
fed by a QStandardItemModel
; tree populates; multiple columns; great! Works. But, I am trying to plan out how to make the actual tree have icons for each node, while the other columns remain just strings. This is a flow of how I populate the model:... root = model.invisibleRootItem() data = [data, data, data] root.appendRow(data)That code is the gist. I know that
QStandardItem
's support initializing with icons. Cool. So, QStandardItem(icon, str)
. But, wouldn't that mean all three items in the passed list (so, all three columns) have an icon? I don't want that. How can I make it so just the first element in data have an icon, but not the other two?I posted this as a feeler. I'm about to continue making love to my IDE, but I'm not sure where to begin. The PyQt docs are what they are. I hope I'm making sense.