0

How do I change the background color of the 'selected' row in a PySide table widget from the default color? (Preferable the style remains the same, just the color scheme changes.)

Perhaps not possible on Linux due to bug: https://bugreports.qt-project.org/browse/QTBUG-34158

Saar Drimer
  • 1,171
  • 2
  • 11
  • 24

1 Answers1

0

Set the selection-background-color property. style sheet reference

From the style sheet examples quite at the bottom:

QTableView { selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0.5, y2: 0.5, stop: 0 #FF92BB, stop: 1 white); }

NoDataDumpNoContribution
  • 10,591
  • 9
  • 64
  • 104
  • It's interesting that 'selection-color' works in changing the colour of the text in the selected row, but 'selection-background-color' for either QTableView or QTableWidget does not work for changing the background colour. I'm still trying to figure out how to make it work. – Saar Drimer Jul 17 '14 at 14:13