painter.scale(1,-1); painter.translate(0, -250);
pen.setWidth(2);
painter.setPen(pen);
float a = 1.0 / 6.0;
cPath.cubicTo(p[1], -a*p[0] + p[1] + a*p[2], a*p[1] + p[2] -a*p[3], p[2]);
pen.setColor(Qt::darkRed);
painter.strokePath(cPath, pen);
QPointF points[5];
points[0] = QPoint(100, 200);
points[1] = QPoint(200, 60);
points[2] = QPoint(500, 180);
points[3] = QPoint(600, 100);
QPainter painter(this);
painter.scale(1,-1); painter.translate(0, -250);
QPen pen;
pen.setWidth(2);
painter.setPen(pen);
float a = 1.0 / 6.0;
cPath.cubicTo(p[1], -a*p[0] + p[1] + a*p[2], a*p[1] + p[2] -a*p[3], p[2]);
pen.setColor(Qt::darkRed);
painter.strokePath(cPath, pen);
To copy to clipboard, switch view to plain text mode
Bookmarks