title: How to set different background colors for each header column of a QTableWidget
body: <p>I have successfully used the following Qt code in my python application to color horizontal headers in a QTableWidget with distinct background colors:</p>
  
  <pre><code>header2 = widget.horizontalHeaderItem(2)
  purple = QColor(139,103,153)
  header2.setBackground(QtGui.QBrush(purple)) 
  
  header3 = widget.horizontalHeaderItem(3)
  orange = QColor(237,168,89)
  header3.setBackground(QtGui.QBrush(orange)) 
  </code></pre>
  
  <p>This is what it looks like:
  <a href="https://i.stack.imgur.com/pXQEB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pXQEB.png" alt="enter image description here"></a></p>
  
  <p>However, in my C++ Qt plugin for an existing application, the equivalent logic does not work for the QTableWidget horizontal headers, but does work for table cells or QTableWidgetItem.</p>
  
  <p>The C++ application has it's own style with a dark theme.  If I replace the style with plastique, then my code works.  </p>
  
  <pre><code>QApplication::setStyle("plastique"); 
  </code></pre>
  
  <p>However, this is not an acceptable solution, as it changes the appearance of the entire application.</p>
  
  <p>I have searched the web and stackoverflow for a solution and <a href="https://stackoverflow.com/a/30888126/259538">this post</a> seems relevant.  It appears to be subclassing QHeaderView, but the implementation is a little advanced for me.  Unfortunately, the post above does not solve work in my case.</p>
  
  <p>Am I on the right track?
  Can someone provide a little more detail about the .h and .cpp and main() implementation?  </p>