2019独角兽企业重金招聘Python工程师标准>>>
#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();
}