Qt、Qwt 中的问题,右键单击 QwtPlot 并获取 X 和 Y 坐标,选择信号
再会! 有 QwtPlot 和 QwtCurve,简称蓝色图,它是使用 Qwt 库构建的。 问题:如何确保在QwtPlot上右键单击时,出现如图所示的红色垂直线(如图中,坐标X是从光标位置取的)?
我可以画一条线,但无法确定将哪个信号连接到插槽绘制。 我尝试将信号 void QwtPlotPicker:: selected (const QPointF & pos) 绑定到插槽绘制,但问题是,单击信号时不起作用(在调试中逐步测试)。 问题可能出在什么地方?
PS 提前致谢!
Good day!
There are QwtPlot and QwtCurve, in short, blue graph, which was built using the library Qwt.
Question: how to make sure that when you right-click on QwtPlot, pictured red vertical line (as in the figure, the coordinate X is taken from the cursor position)?
I can draw a line, but I can not determine which signal to connect to a slot draw.
I tried to signal void QwtPlotPicker:: selected (const QPointF & pos) bind to a slot draw, but the problem is that when Clicking the signal does not work (tested step by step in debugging).
In what may be the problem?
P.S. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 QwtPlotPicker 是否使用绘图的画布进行了初始化? QwtPlotPicker 的 SelectionFlags 设置为多少? (您应该使用 QwtPicker::ClickSelection)
Is your QwtPlotPicker initialized with the canvas of the plot? And what are your selectionFlags set to for the QwtPlotPicker? (You should be using QwtPicker::ClickSelection)