Code: Alles auswählen
void ModulesTableItem::paint( QPainter * p, const QColorGroup & cg, const QRect & cr, bool selected ){
p->fillRect( 0, 0, cr.width(), cr.height(), cg.brush( QColorGroup::Highlight ) );
int w = cr.width();
int h = cr.height();
QSize sz = QSize( table()->style().pixelMetric( QStyle::PM_IndicatorWidth ),
table()->style().pixelMetric( QStyle::PM_IndicatorHeight ) );
QColorGroup c( cg );
c.setBrush( QColorGroup::Background, c.brush( QColorGroup::Base ) );
QStyle::SFlags flags = QStyle::Style_Default;
if(isEnabled())
flags |= QStyle::Style_Enabled;
if ( this->isChecked() )
flags |= QStyle::Style_On;
else
flags |= QStyle::Style_Off;
if ( isEnabled() && table()->isEnabled() )
flags |= QStyle::Style_Enabled;
table()->style().drawPrimitive( QStyle::PE_Indicator, p,
QRect( 40, ( h - sz.height() ) / 2, sz.width(), sz.height() ), c, flags );
int x = sz.width() + 6;
w = w - x;
/* if ( selected )
p->setPen( cg.highlightedText() );
else
p->setPen( cg.text() );
p->drawText( x, 0, w, h, wordWrap() ? ( alignment() | WordBreak ) : alignment(), text() );*/
}