QTreeWidget with different icon sizes
I'm trying to set different icon size for top level items of QTreeWidget. I think the way is custom QItemDelegate, but i'm not sure how to do it (delegates are a bit confusing to me). I tryed to subclass "sizeHint()", but it only affects to the item size, not to icon size:
Code:
if ( index.data(Qt::UserRole).toString() == "TopLevel1") {
return QSize(skSets.
value("SystemsTree/HIconSize").
toInt(), skSets.
value("SystemsTree/HIconSize").
toInt());
} else {
return QSize(skSets.
value("SystemsTree/IconSize").
toInt(), skSets.
value("SystemsTree/IconSize").
toInt());
}
}
How can i apply the sizehint to the icon?
I've noticed that the second arg ofsizeHint() is a QModelIndex, not sure if i must do a cast to QTreeWidget or something....
Hope anybody can help me.
Thanks in advance.