Kryzon
1st November 2014, 09:51
Hello.
My implementation of 'paintEvent' is giving a particular 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 );
}
Looking like this:
http://s7.postimg.org/3s67tyfwb/painter_Path.png
Shouldn't the intersected region between the rectangle and the bezier path be filled in the path generated by the 'simplified' call?
My implementation of 'paintEvent' is giving a particular 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 );
}
Looking like this:
http://s7.postimg.org/3s67tyfwb/painter_Path.png
Shouldn't the intersected region between the rectangle and the bezier path be filled in the path generated by the 'simplified' call?