Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to set the color value of a cell text in QTableView in Qt, hoping to paste the code.
How to set the color value of a cell text in QTableView in Qt, hoping to paste the code.
QTableView is used for view-delegate-model type; If you want to change the color of cell text, you can still use QTableWidget.

Suppose the name of the QTableWidget on the interface is? tableWidget

ui-& gt; table widget-& gt; item(0,0)-& gt; set foreground(Qt::red);