QPainter painter(this);
QPen pen(QColor(255,0,0));
pen.setWidth(5);
pen.setStyle(Qt::DotLine); //笔风格
painter.setPen(pen);
QBrush brush(Qt::cyan);
painter.setBrush(brush);
//画线
painter.drawLine(QPoint(0,0),QPoint(50,50));
//圆形
painter.drawEllipse(QPoint(100,100),50,50);
//画矩形
painter.drawRect(QRect(20,20,100,100));
//画
painter.setRenderHint(QPainter::Antialiasing);
//圆角矩形
painter.drawRoundRect(20,20,210,160,50,50);
//圆弧
painter.drawArc(20,20,210,160,500,1000);
QPainter
最新推荐文章于 2021-01-08 14:56:56 发布