ctarsoaga
1st February 2010, 13:08
Hi everybody,
I need to customize some of the items I add inside a QTreeView.
I was hoping to achieve this without using a delegate and override paint().
I wanted to use setProperty() for each item and then tell the stylesheet SOMEHOW to get a different background for the items depending on that property.
cpp: item->setProperty("myproperty", "customizeMe")
qss: QTreeView::item[myproperty="customizeMe"] { background=rgb(...) }
This does not work, the items are rendered using the default style. What options do I have? Is this NOT possible using stylesheets only?
Thanks
Chris
I need to customize some of the items I add inside a QTreeView.
I was hoping to achieve this without using a delegate and override paint().
I wanted to use setProperty() for each item and then tell the stylesheet SOMEHOW to get a different background for the items depending on that property.
cpp: item->setProperty("myproperty", "customizeMe")
qss: QTreeView::item[myproperty="customizeMe"] { background=rgb(...) }
This does not work, the items are rendered using the default style. What options do I have? Is this NOT possible using stylesheets only?
Thanks
Chris