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.
-
@Lobstw
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));
QBrush brush(gradient); -
@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
-
@Lobstw
Yes QRadialGradient is pretty awesome. :)
btw there is also QLinearGradient
http://doc.qt.io/qt-5.5/qgradient.htmljust in case u didnt see them