代码之家  ›  专栏  ›  技术社区  ›  Thomi

Qt样式表:选择视图数据时,QHeaderView以粗体绘制标题文本

  •  12
  • Thomi  · 技术社区  · 16 年前

    我试过这样的方法:

    QTableView::section {
        font-weight: 400;
    }
    QTableView::section:selected {
        font-weight: 400;
    }
    
    QHeaderView {
        font-weight: 400;
    }
    
    QHeaderView::section {
        font-weight: 400;
    }
    

    无济于事。

    2 回复  |  直到 16 年前
        1
  •  27
  •   feedc0de RushPL    9 年前

    QHeaderView::highlightSections 属性设置为false应该可以实现此目的。

    verticalHeader() horizontalHeader()

        2
  •  0
  •   sercxjo    7 年前

    在Qt Designer UI格式中,可以使用属性 horizontalHeaderHighlightSections :

     <widget class="QTableView" name="m_studyList">
      <attribute name="horizontalHeaderHighlightSections">
       <bool>false</bool>
      </attribute>
    

    但它也完全禁用选定列的css。