setPalette for QTableWidgetItem in Qt5
Is the setPalette option still available for table cells in Qt5?
I am trying to partially fill the background of a table cell. So if cell value is 50 then make cell background half filled with yellow.
I think not but it has setbrush and it can make gradiants
QRadialGradient gradient(50, 50, 50, 50, 50);
gradient.setColorAt(0, QColor::fromRgbF(0, 1, 0, 1));
gradient.setColorAt(1, QColor::fromRgbF(0, 0, 0, 0));
@mrjj I don't think table items have a setbrush. The only set options that I can see are available are: (Background, Checkstate, Data, Flags, Font, Foreground, Icon, Selected, SizeHint, StatusTip, Text, Text Alignment, Tooltip, WhatsThis)
edit: setBackground and setForeground come from QBrush though
Hi yes it was
setBackground(const QBrush & brush) i was thinking of.
@mrjj Hello, setBackground seems to have done the trick, how may I apply it to only a part of the cell instead of the whole thing? Thank you.
brush is for whole cell, so you have to fake it and make gradiant be normal color in the end
you want to look normal.
@mrjj I used three setcolorat options and it works well! Great stuff
just in case u didnt see them