QTreeView ui相关
ui->tableView->horizontalHeader()->setSectionResizeMode(2,QHeaderView::Stretch);//指定列宽铺满
ui->tableView->horizontalHeader()->setStretchLastSection(true); //最后一行是否铺满剩余空间
ui->tableView->verticalHeader()->setVisible(false); //隐藏垂直表头
ui->tableView->verticalHeader()->setDefaultSectionSize(38);//设置行高
ui->tableView->setColumnWidth(0,50);//设置指定列宽
QSS:
/*QTableView 左上角样式*/
QTableView QTableCornerButton::section {
/* background: red;
border: 2px outset red;*/
color: red;
background-color: #E5E9F8;
border: 5px solid #f6f7fa;
border-radius:0px;
border-color: #E5E9F8;
}
QTableView {
color: #033B77; /*表格内文字颜色*/
gridline-color: white; /*表格内框颜色*/
background-color: white; /*表格内背景色*/
alternate-background-color: #E5E9F8;
selection-background-color: white; /*选中区域的背景色*/
border-radius: 0px;
padding: 2px 4px;
}
QHeaderView {
color: #033B77;
font: bold 10pt;
background-color: #E5E9F8;
min-height:29px;
}
QHeaderView::section {
color: #033B77;
background-color: #E5E9F8;
border-radius:0px;/*展示表頭平面效果*/
border-color: red;
}