i want to display icon in center of qstandarditem,but can't find way to work out ,colund somebody tell me how to do it?
i want to display icon in center of qstandarditem,but can't find way to work out ,colund somebody tell me how to do it?
delegates... delegates
calculate the position / rect where you want to draw the icon, and call QItemDelegate::drawDecoration with this modified rect ...
You will also need to adjust ur displayRect aslo might be.
thank you ,but i do't draw icon, i create standarditem with icon .for example:
qstandarditem testitem=new QStandardItem(iconObject);
how to set the iconObject to center?
I dont think any of the default views paint the icon in center... they provide left, right, top, bottom... but not center
u might need to use delegates..
Bookmarks