[SOLVED] How to delete internal curves in QPainterPath



  • alt text


  • Qt Champions 2016

    Hi and welcome
    It has an overloaded + operator so you can just use that.
    Note: This does not delete it as such, it combines.

    void SWidget::paintEvent ( QPaintEvent* e )
    {
        QPainter p ( this );
    
        QPainterPath path1;
        path1.addRect ( 20, 20, 60, 60 );
        QPainterPath path2;
        path2.addEllipse ( 40, 40, 60, 60 );
        QPainterPath path3 = path1 + path2;
        p.drawPath ( path3 );
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.