28 const int textMinWidth = fontMetrics().boundingRect( mText ).width();
29 mTextHeight = fontMetrics().height();
31 mMinWidth = 2 * mLabelMargin + textMinWidth;
32 setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed );
48 QPainter painter(
this );
49 const QPalette
pal = QPalette( qApp->palette() );
50 const QColor headerBgColor =
pal.color( QPalette::Mid );
51 const QColor headerTextColor =
pal.color( QPalette::BrightText );
54 painter.setBrush( headerBgColor );
55 painter.setPen( Qt::NoPen );
56 painter.drawRect( QRect( 0, 0, width(), mTextHeight + mLabelMargin ) );
59 painter.setPen( headerTextColor );
60 painter.drawText( QPoint( mLabelMargin, 0.25 * mLabelMargin + mTextHeight ), mText );