tableview.qss 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. border: none; /* 无外边框 */
  22. alternate-background-color: transparent; /* 交替行背景颜色 */
  23. gridline-color: transparent; /* 网格线颜色透明 */
  24. }
  25. /* 表头样式 */
  26. QHeaderView::section {
  27. background-color: #4472C4;
  28. font-weight: bold;
  29. color: white;
  30. height: 34px; /* 表头高度 */
  31. resize-mode: Stretch; /* 表头自适应拉伸 */
  32. }
  33. /* 交替行样式 */
  34. QTableView::item:alternate {
  35. border: 0.5px solid transparent; /* 白色内边框 */
  36. background-color: transparent;
  37. padding: 5px; /* 设置单元格内边距,增加行距 */
  38. }
  39. /* 普通行样式 */
  40. QTableView::item {
  41. border: 0.5px solid #BDC8E2; /* 白色内边框 */
  42. background-color: #D9E1F2;
  43. padding: 5px; /* 设置单元格内边距,增加行距 */
  44. }
  45. /* 垂直表头行高 */
  46. QTableView QHeaderView::vertical::section {
  47. height: 28px;
  48. }