Change the selection color of a QTableWidget

后端 未结 1 1599
感情败类
感情败类 2021-01-04 21:01

The default is for the selected row to be colored gray if the QTableWidget does not have focus, and orange if it does have focus. I would like to, instead, make the selected

相关标签:
1条回答
  • 2021-01-04 21:29

    You almost had it. Technically speaking, you're adjusting the selection color of the items within your table widget, so:

    QTableWidget::item{ selection-background-color: red}
    

    should do the trick.

    Alternatively:

    QTableWidget::item{ background-color: blue }
    QTableWidget::item:selected{ background-color: red }
    
    0 讨论(0)
提交回复
热议问题