设置水平和垂直表头的颜色
ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background:yellow;}");
ui->tableWidget->verticalHeader()->setStyleSheet("QHeaderView::section{background:yellow;}");
左上角两个表头相交的区域也设置成同样的颜色
ui->tableWidget->setStyleSheet("QTableCornerButton::section{background:yellow;}");
- setCornerButtonEnabled(bool)
- setCornerWidget(QWidget *)