Setting QTabWidget's Text with a QStyle
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
Code:
{
void drawComplexControl
(
ComplexControl control,
) const
{
switch(control)
{
case CC_GroupBox:
if( widget != 0 )
{
groupBox
->textColor
= QColor(255,
255,
255);
QWindowsStyle::drawComplexControl( control, groupBox, painter, widget
);
}
else
{
QWindowsStyle::drawComplexControl( control, option, painter, widget
);
}
break; // end case CC_GroupBox
default:
QWindowsStyle::drawComplexControl( control, option, painter, widget
);
}
}
};
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