{
p.
setBrush( QBrush( Qt
::gray ) );
myPath.moveTo( 600.0, 250.0 );
myPath.cubicTo( 90.0, 50.0, 0.0, 50.0, 50.0, 370.0 );
myPath.cubicTo( 140.0, 20.0, 10.0, 10.0, 600.0, 250.0 );
myPath.addRect( 10.0, 300.0, 160.0, 34.0 );
p.drawPath( result );
}
void Widget::paintEvent( QPaintEvent * event )
{
QPainter p ( this );
p.setPen( QPen( QBrush( Qt::darkRed ), 2 ) );
p.setBrush( QBrush( Qt::gray ) );
QPainterPath myPath;
myPath.moveTo( 600.0, 250.0 );
myPath.cubicTo( 90.0, 50.0, 0.0, 50.0, 50.0, 370.0 );
myPath.cubicTo( 140.0, 20.0, 10.0, 10.0, 600.0, 250.0 );
myPath.addRect( 10.0, 300.0, 160.0, 34.0 );
QPainterPath result ( myPath.simplified() );
p.drawPath( result );
}
To copy to clipboard, switch view to plain text mode
Bookmarks