Hi,

I am trying to change the QTabWidget's text to a different color using a Style. Right now I have a subclass of QWindowsStyle

Qt Code:
  1. class MyWindowsStyle : public QWindowsStyle
  2. {
  3. void drawComplexControl
  4. (
  5. ComplexControl control,
  6. const QStyleOptionComplex * option,
  7. QPainter * painter,
  8. const QWidget * widget = 0
  9. ) const
  10. {
  11. switch(control)
  12. {
  13. case CC_GroupBox:
  14. if( widget != 0 )
  15. {
  16. QStyleOptionGroupBox *groupBox = new QStyleOptionGroupBox(*(qstyleoption_cast<const QStyleOptionGroupBox*>(option)) );
  17. groupBox->textColor = QColor(255, 255, 255);
  18.  
  19. QWindowsStyle::drawComplexControl( control, groupBox, painter, widget );
  20. }
  21. else
  22. {
  23. QWindowsStyle::drawComplexControl( control, option, painter, widget );
  24. }
  25. break; // end case CC_GroupBox
  26. default:
  27. QWindowsStyle::drawComplexControl( control, option, painter, widget );
  28. }
  29. }
  30. };
To copy to clipboard, switch view to plain text mode 

that changes the text of QGroupBox'es to a different color. I wanted to extend this class to change the color of the TabWidget's text.
I can not figure out, how to this for a QTabWidget ... Any ideas?

(I know I can just use the QTabWidget::setTabTextColor, but than I would have to do this every time I use the TabWidget and it would not work good together with other styles)

Taurho