tableview.qss 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. QWidget {
  2. background-color: #ffffff;
  3. color: rgb(48, 65, 86);
  4. /*border: 1px solid rgb(48, 65, 86);*/
  5. font-weight: bold;
  6. }
  7. QPushButton {
  8. background-color: #222222;
  9. color: #ffffff;
  10. border: 2px solid #ffffff;
  11. }
  12. QLineEdit, QComboBox {
  13. color: rgb(48, 65, 86);
  14. }
  15. QLabel {
  16. color:rgb(48, 65, 86);
  17. font-weight: bold;
  18. }
  19. /* 表格视图样式 */
  20. QTableView {
  21. gridline-color: #4472C4;
  22. border: 0.1px solid #4472C4; /* 外边框颜色 */
  23. selection-color: #9f4b2c; /* 选中行文字颜色 */
  24. font-size: 14px; /* 字体大小 */
  25. font-family: "Microsoft YaHei", "Arial", sans-serif; /* 字体 */
  26. show-decoration-selected: 1; /* 显示选中行的装饰 */
  27. }
  28. /* 序号列header */
  29. QTableCornerButton::section {
  30. background-color: #4472C4;
  31. }
  32. /* 表头样式 */
  33. QHeaderView::section {
  34. background-color: #4472C4;
  35. font-weight: bold;
  36. color: white;
  37. height: 34px; /* 表头高度 */
  38. }
  39. /* 普通行样式 */
  40. QTableView::item {
  41. border: 0.5px solid #000308; /* 白色内边框 */
  42. background-color: #D9E1F2;
  43. padding: 5px; /* 设置单元格内边距,增加行距 */
  44. }
  45. /* 垂直表头行高 */
  46. QTableView QHeaderView::vertical::section {
  47. height: 28px;
  48. }