0

I have QT TableWidget and I would like to change background color of column based on their value. Seems I can change all columns background doing something like this:

tableWidget->horizontalHeader()->setStyleSheet("QHeaderView::section {background-color: red}");

But I want to change color for given column and each column color can be different. Anyone has done anything like this ?

  • This may help: http://stackoverflow.com/questions/30847252/what-does-qheaderviewpaintsection-do-such-that-all-i-do-to-the-painter-before – Alexander V Jun 16 '16 at 22:06

1 Answers1

0

You may consider using QTableView and the Qt Model/View framework to do that.

Fryz
  • 2,119
  • 2
  • 25
  • 45