void renderLine() {
image.fill(qRgb(255, 255, 255));
// these line segments with red color fill start/end points
p.setPen(Qt::red);
// these line segments with blue color doesn't fill start/end points
// looks like y-coord is not respected
p.setPen(Qt::blue);
}
void renderLine() {
image.fill(qRgb(255, 255, 255));
QPainter p(&image);
// these line segments with red color fill start/end points
p.setPen(Qt::red);
p.drawLine(QPoint(7, 2), QPoint(7, 5));
p.drawLine(QPoint(9, 7), QPoint(12, 7));
p.drawLine(QPoint(7, 9), QPoint(7, 12));
p.drawLine(QPoint(2, 7), QPoint(5, 7));
p.drawLine(QPoint(5, 5), QPoint(3, 3));
p.drawLine(QPoint(9, 9), QPoint(11, 11));
// these line segments with blue color doesn't fill start/end points
// looks like y-coord is not respected
p.setPen(Qt::blue);
p.drawLine(QPoint(9, 5), QPoint(11, 3));
p.drawLine(QPoint(5, 9), QPoint(3, 11));
}
To copy to clipboard, switch view to plain text mode
Bookmarks