首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >QPainterPath和cubicTo,光滑线

QPainterPath和cubicTo,光滑线
EN

Stack Overflow用户
提问于 2014-08-12 07:41:40
回答 1查看 1.6K关注 0票数 1

我试图通过平滑的线连接点,如图像所示。

怎样才能像图像中所示的那样得到平滑的线条?

代码语言:javascript
复制
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/

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-12 08:25:01

我写了这段代码,得到了类似的结果

代码语言:javascript
复制
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();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25258743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档