[PyQt] Background color for cells in QTableView
David Boddie
david at boddie.org.uk
Sat Jun 25 01:26:58 BST 2011
On Fri Jun 24 20:30:32 BST 2011, Marc Rossi wrote:
> I have a model/view app with a QTableView that I would like to have columns
> 2, 3 & 4 shaded a different color than the rest. My model sub-classes
> QAbstractTableModel and I also use a QSortFilterProxyModel. I assumed I
> could just override the data() method in my QAbstractTableModel derived
> class, returning the correct QBrush when called with role =
> Qt.BackgroundRole, but my data method NEVER gets called with this role.
> I currently use a stylesheet to set the entire background of the
> QTableView.
Just a thought: have you tried it without the stylesheet?
David
More information about the PyQt
mailing list