QWidget { background-color: #ffffff; color: rgb(48, 65, 86); /*border: 1px solid rgb(48, 65, 86);*/ font-weight: bold; } QPushButton { background-color: #222222; color: #ffffff; border: 2px solid #ffffff; } QLineEdit, QComboBox { color: rgb(48, 65, 86); } QLabel { color:rgb(48, 65, 86); font-weight: bold; } /* 表格视图样式 */ QTableView { border: none; /* 无外边框 */ alternate-background-color: transparent; /* 交替行背景颜色 */ gridline-color: transparent; /* 网格线颜色透明 */ } /* 表头样式 */ QHeaderView::section { background-color: #4472C4; font-weight: bold; color: white; height: 34px; /* 表头高度 */ } /* 交替行样式 */ QTableView::item:alternate { border: 0.5px solid transparent; /* 白色内边框 */ background-color: transparent; padding: 5px; /* 设置单元格内边距,增加行距 */ } /* 普通行样式 */ QTableView::item { border: 0.5px solid #BDC8E2; /* 白色内边框 */ background-color: #D9E1F2; padding: 5px; /* 设置单元格内边距,增加行距 */ } /* 垂直表头行高 */ QTableView QHeaderView::vertical::section { height: 28px; }