16 #include <qstyleoption.h>
66 setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
182 const QMargins m = contentsMargins();
194 if (
align & Qt::AlignLeft ||
align & Qt::AlignRight )
196 else if (
align & Qt::AlignTop ||
align & Qt::AlignBottom )
200 sz += QSizeF( mw, mh );
217 const QMargins m = contentsMargins();
220 if ( renderFlags & Qt::AlignLeft || renderFlags & Qt::AlignRight )
224 if ( ( renderFlags & Qt::AlignTop ) || ( renderFlags & Qt::AlignBottom ) )
238 QPainter painter(
this );
239 painter.setClipRegion( event->region() );
243 style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter,
this);
245 if ( !contentsRect().contains( event->rect() ) )
247 painter.setClipRegion( event->region() & frameRect() );
248 drawFrame( &painter );
251 painter.setClipRegion( event->region() & contentsRect() );
263 painter->setFont( font() );
264 painter->setPen( palette().
color( QPalette::Active, QPalette::Text ) );
272 QRect focusRect = contentsRect().adjusted( m, m, -m + 1, -m + 1);
290 QRect r = contentsRect();
295 r.adjust( m, m, -m, -m );
308 if ( renderFlags & Qt::AlignLeft )
312 else if ( renderFlags & Qt::AlignRight )
314 r.setWidth( r.width() -
indent );
316 else if ( renderFlags & Qt::AlignTop )
320 else if ( renderFlags & Qt::AlignBottom )
322 r.setHeight( r.height() -
indent );
332 if ( frameWidth() <= 0 )
345 #include "moc_qwt_text_label.cpp"