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. 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. }
  32. /* 交替行样式 */
  33. QTableView::item:alternate {
  34. border: 0.5px solid transparent; /* 白色内边框 */
  35. background-color: transparent;
  36. padding: 5px; /* 设置单元格内边距,增加行距 */
  37. }
  38. /* 普通行样式 */
  39. QTableView::item {
  40. border: 0.5px solid #BDC8E2; /* 白色内边框 */
  41. background-color: #D9E1F2;
  42. padding: 5px; /* 设置单元格内边距,增加行距 */
  43. }
  44. /* 垂直表头行高 */
  45. QTableView QHeaderView::vertical::section {
  46. height: 28px;
  47. }