【发布时间】:2014-08-12 07:41:40
【问题描述】:
我正在尝试用平滑线连接点,如图所示。
我怎样才能得到如图所示的平滑线条?
QPainterPath myPath(A);
myPath.cubicTo(A,A,B);
myPaht.cubicTo(B,B,C);
myPath.cubicTo(C,C,D);
myPainter.drawPath(myPath);
【问题讨论】:
我正在尝试用平滑线连接点,如图所示。
我怎样才能得到如图所示的平滑线条?
QPainterPath myPath(A);
myPath.cubicTo(A,A,B);
myPaht.cubicTo(B,B,C);
myPath.cubicTo(C,C,D);
myPainter.drawPath(myPath);
【问题讨论】:
我写了这段代码,得到了类似的结果
QPainterPath myPath(QPointF(50,50));//start point
myPath.cubicTo(60,25,80,80,90,60); //set another points
scene->addPath(myPath,QPen(Qt::red));//I use graphicsscene, but you can use, what you want
ui->graphicsView->setScene(scene);
ui->graphicsView->show();
【讨论】: