void painter::paintEvent(QPaintEvent *e) { QPainter pt(this); QPen pen1(Qt::black); pen1.setWidth(2); QPen pen2(Qt::red); pen2.setWidth(5); QPoint p1; p1.setX(10); p1.setY(10); QPoint p2; p2.setX(200); p2.setY(500); pt.setPen(pen1); pt.drawLine(p1,p2); pt.setPen(pen2); pt.drawPoint(p1); pt.drawPoint(p2); }
QPainter Basic
原文地址:https://www.cnblogs.com/TadGuo/p/9175626.html
时间: 2024-11-06 07:13:01