Qt之QtPainter:画圆角矩形和多边形

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

#include 
#include 
void MainWindow::paintEvent(QPaintEvent *)
{
    QPainter painter;
    painter.begin(this);

    painter.setPen(Qt::blue);
    QRectF rect(120, 10.0, 80.0, 80.0);
    painter.drawRoundedRect(rect, 20, 20); // round rect

    QPointF p2[3] = {
                    QPointF(120.0, 110.0),
                    QPointF(220.0, 110.0),
                    QPointF(220.0, 190.0)
                    };

    painter.drawPolygon(p2, 3); // drawing shape with points

    painter.end();
}

Qt之QtPainter:画圆角矩形和多边形_第1张图片

转载于:https://my.oschina.net/u/3919756/blog/1942395

你可能感兴趣的:(python)