QTreeview Apply delegate based on specific Condition
Solved
General and Desktop
-
-
Hi
https://doc.qt.io/qt-5/qabstractitemview.html#setItemDelegateForColumn
If you mean to apply different delegates based on the UserRole -
@mrjj Okay i think i can make use of setItemDelegateForRow(rowNo,MyDelegate*);
But which is best place to set this ? . DO i need to explicitly check each model index or can i use model data() function to set ? If so please share a code snippet -
@DonCoder
As far as I know we can only set a delegate with the setItemXX functions.But im wondering. Could you not just have one Delegate and it reads
the UserRole and then paint the cell accordingly?