static QWidget *qwtBGWidget( QWidget *widget ) { QWidget *w = widget; for ( ; w->parentWidget() != NULL; w = w->parentWidget() ) { if ( w->autoFillBackground() || w->testAttribute( Qt::WA_StyledBackground ) ) { return w; } } return w; }
void QwtPlotAbstractCanvas::drawUnstyled( QPainter *painter ) { fillBackground( painter ); QWidget *w = canvasWidget(); if ( w->autoFillBackground() ) { const QRect canvasRect = w->rect(); painter->save(); painter->setPen( Qt::NoPen ); painter->setBrush( w->palette().brush( w->backgroundRole() ) ); const QRect frameRect = w->property( "frameRect" ).toRect(); if ( borderRadius() > 0.0 && ( canvasRect == frameRect ) ) { const int frameWidth = w->property( "frameWidth" ).toInt(); if ( frameWidth > 0 ) { painter->setClipPath( borderPath2( canvasRect ) ); painter->drawRect( canvasRect ); } else { painter->setRenderHint( QPainter::Antialiasing, true ); painter->drawPath( borderPath2( canvasRect ) ); } } else { painter->drawRect( canvasRect ); } painter->restore(); } drawCanvas( painter ); }