void QwtPlotAbstractCanvas::drawCanvas( QPainter *painter ) { QWidget *w = canvasWidget(); painter->save(); if ( !d_data->styleSheet.borderPath.isEmpty() ) { painter->setClipPath( d_data->styleSheet.borderPath, Qt::IntersectClip ); } else { if ( borderRadius() > 0.0 ) { const QRect frameRect = w->property( "frameRect" ).toRect(); painter->setClipPath( borderPath2( frameRect ), Qt::IntersectClip ); } else { painter->setClipRect( w->contentsRect(), Qt::IntersectClip ); } } QwtPlot *plot = qobject_cast< QwtPlot *>( w->parent() ); if ( plot ) plot->drawCanvas( painter ); painter->restore(); }
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 ); }
QPainterPath QwtPlotGLCanvas::borderPath( const QRect &rect ) const { return borderPath2( rect ); }