天天看點

QTableWidget顯示模式設定

1. 設定表頭背景顔色

ui->tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section{background-color:skyblue}");
           

2. 設定表格列拉伸

ui->tableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
           

繼續閱讀