如何在QT中的两个已知点之间绘制弧线?
我想在点d点之间绘制一个弧度,它应该触摸到E。(我想绘制和门符号)
我尝试过这种方式
QPainterPath path;
path.arcTo(60,30,46,100,30*16,120*16); // ( x,y,width,height, startAngle,spanAngle)
,但它正在绘制完整的圆圈,而不是在适当的位置。
当前看起来像
在此处输入图像描述”> 得到建议,我尝试了这样的建议:
path.moveTo(106, 80);
path.arcTo(76.0, 30.0, 60.0, 100.0, 90.0, -180.0);
如何摆脱该垂直线(内部和门)?
为什么出现?
I want to draw an arc between point B to point D and it should touch to point E. ( I want to draw AND gate symbol )
I tried this way
QPainterPath path;
path.arcTo(60,30,46,100,30*16,120*16); // ( x,y,width,height, startAngle,spanAngle)
But it is drawing full circle and not in proper place.
Currently it is looking like this
After getting suggestion I tried like this :
path.moveTo(106, 80);
path.arcTo(76.0, 30.0, 60.0, 100.0, 90.0, -180.0);
How to get rid of that vertical line ( inside AND gate ) ?
Why it is appearing ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您误解了
给定图像,您应该将路径移动到
(106,80)
(边界矩形中心)path.moveto(106,80)
;界限矩形
弧itsel应在
90°
上具有启动角
,并且应跨度180°
在负方向上。这将导致:
path.arcto(76.0,30.0,60.0,100.0,90.0,-180.0);
更新
arcto
I think you misunderstood the parameters for arcTo, especially the bounding rectangle.
Given your image, you should move path to
(106, 80)
(center of the bounding rectangle)path.moveTo(106, 80)
;The bounding rectangle of the arc should look like this:
The arc itsel should have a
start angle
at90°
and should span180°
in negative direction.This results in:
path.arcTo(76.0, 30.0, 60.0, 100.0, 90.0, -180.0);
Update
arcTo