Qt 6.11 is out! See what's new in the release
blog
How to change the text color in QTableView
General and Desktop
3
Posts
3
Posters
22.3k
Views
1
Watching
-
Check QItemDelegate::drawDisplay.
-
Rajveer, are you using a QTableView this time, or are you really using a QTableModel as you were in your last questions?
In the latter case, you should check out setting the Qt::ForeGroundRole on the cell you want to color.
@
QTableWidgetItem* myItem; //set it to the item you want to manipulatemyItem->setForeground(QColor::fromRgb(255,0,0)); //make this item red.
@If you really have your own model, then you need to return this color as a variant from your data() method, but I doubt you are doing that.