Unsolved How to set 3 color in one column of QTreeWidgetItem?
-
How to set 3 color in one column of QTreeWidgetItem?
Create a Pixmap and then use setPixmap? -
use setData function with either decoration role or background role by passing the appropriate QColor value.
-
i want multiple color in just 1 column....
-
eg. cut the column in 2 half part , and each part fill with different color
-
anyone can help? thx
-
custom delegate!
you need to reimplementQStyledItemDelegate::paint
-
can i customize a QPixmap, and set this QPixmap by setIcon to that column?
-
@opengpu2 I would not go down this path. At least I'd set it as Qt::BackgroundRole but, again, a custom delegate is the right solution.
Are the background colors dependant on the content of the cell?
-
@VRonin yes, depend on the content, and the number of colors are not the same, maybe 1,2 ,3, etc..
-
@VRonin if i use delegate, actually just for this column in order to make it consist of colors, and i donot want to make any change to the other columns
-
ok, if you describe how to determine the number of colours, how much space each colour should take in the cell and how to determine the colour itself (I mean red, blue, yellow, etc.). I can draft a basic delegate up
-
@VRonin that's easy in my situation, just make the space for each color equal.
-
@opengpu2 Yes but how do I determine which colors to use and what cells should have the double color?