tableview.qss 915 B

12345678910111213141516171819202122232425262728293031323334
  1. /* 表格视图样式 */
  2. QTableView {
  3. border: none; /* 无外边框 */
  4. alternate-background-color: transparent; /* 交替行背景颜色 */
  5. gridline-color: transparent; /* 网格线颜色透明 */
  6. }
  7. /* 表头样式 */
  8. QHeaderView::section {
  9. background-color: #4472C4;
  10. font-weight: bold;
  11. color: white;
  12. height: 34px; /* 表头高度 */
  13. resize-mode: Stretch; /* 表头自适应拉伸 */
  14. }
  15. /* 交替行样式 */
  16. QTableView::item:alternate {
  17. border: 0.5px solid transparent; /* 白色内边框 */
  18. background-color: transparent;
  19. padding: 5px; /* 设置单元格内边距,增加行距 */
  20. }
  21. /* 普通行样式 */
  22. QTableView::item {
  23. border: 0.5px solid #BDC8E2; /* 白色内边框 */
  24. background-color: #D9E1F2;
  25. padding: 5px; /* 设置单元格内边距,增加行距 */
  26. }
  27. /* 垂直表头行高 */
  28. QTableView QHeaderView::vertical::section {
  29. height: 28px;
  30. }