我试图通过平滑的线连接点,如图像所示。
怎样才能像图像中所示的那样得到平滑的线条?
QPainterPath myPath(A);
myPath.cubicTo(A,A,B);
myPaht.cubicTo(B,B,C);
myPath.cubicTo(C,C,D);
myPainter.drawPath(myPath);图片:- http://postimg.org/image/44vh9m2ur/
发布于 2014-08-12 08:25:01
我写了这段代码,得到了类似的结果
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();https://stackoverflow.com/questions/25258743
复制相似问题