How to change the header background color of a QTableView
You can set the style sheet on the QTableView
ui->tableView->setStyleSheet("QHeaderView::section { background-color:red }");
for more info see http://doc.qt.io/qt-4.8/stylesheet-examples.html