本文整理汇总了C++中QwtPlot::drawCanvas方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlot::drawCanvas方法的具体用法?C++ QwtPlot::drawCanvas怎么用?C++ QwtPlot::drawCanvas使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlot
的用法示例。
在下文中一共展示了QwtPlot::drawCanvas方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawCanvas
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();
}
示例2: drawItems
/*!
Draw the plot items
\param painter Painter
\sa QwtPlot::drawCanvas()
*/
void QwtPlotGLCanvas::drawItems( QPainter *painter )
{
painter->save();
painter->setClipRect( contentsRect(), Qt::IntersectClip );
QwtPlot *plot = qobject_cast< QwtPlot *>( parent() );
if ( plot )
plot->drawCanvas( painter );
painter->restore();
}
示例3: paintEvent
virtual void paintEvent( QPaintEvent *event )
{
QPainter painter( this );
painter.setClipRegion( event->region() );
QwtPlot *plot = qobject_cast< QwtPlot *>( parent() );
if ( plot )
plot->drawCanvas( &painter );
painter.setPen( palette().foreground().color() );
painter.drawRect( rect().adjusted( 0, 0, -1, -1 ) );
}