Suppose the name of the QTableWidget on the interface is? tableWidget
ui-& gt; table widget-& gt; item(0,0)-& gt; set foreground(Qt::red);