Qt数据库表样式

这篇博客详细介绍了如何使用QTableView在Qt中定制左上角的角落按钮样式,以及整个表格的颜色、边框、网格线、选中区域等视觉效果。通过设置CSS样式,实现了从背景色、文字颜色到边框样式的全面定制,创建出专业且美观的表格界面。
摘要由CSDN通过智能技术生成

/QTableView 左上角样式/
QTableView QTableCornerButton::section {
/* background: red;
border: 2px outset red;*/
color: red;
background-color: rgb(64, 64, 64);
border: 5px solid #f6f7fa;
border-radius:0px;
border-color: rgb(64, 64, 64);
}

QTableView {

color: white;                                       /*表格内文字颜色*/
gridline-color: black;                              /*表格内框颜色*/
background-color: rgb(108, 108, 108);               /*表格内背景色*/
alternate-background-color: rgb(64, 64, 64);
selection-color: white;                             /*选中区域的文字颜色*/
selection-background-color: rgb(85, 170, 255);        /*选中区域的背景色*/
border: 2px groove gray;
border-radius: 0px;
padding: 2px 4px;

}

QHeaderView {
color: white;
font: bold 10pt;
background-color: rgb(108, 108, 108);
border: 0px solid rgb(144, 144, 144);
border:0px solid rgb(191,191,191);
border-left-color: rgba(255, 255, 255, 0);
border-top-color: rgba(255, 255, 255, 0);
border-radius:0px;
min-height:29px;
}

QHeaderView::section {
color: white;
background-color: rgb(64, 64, 64);
border: 5px solid #f6f7fa;
border-radius:0px;
border-color: rgb(64, 64, 64);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值