Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to make line Dragable/Movable along the graph ?
npatil15 last edited by npatil15
I'm developing a graph, in which I want two horizontal and vertical lines which also be movable/dragable.
Now using QWT libraries, in which I have used QwtPlotScaleItem to draw line, but unable to drag the line. May be I can use mouse event but not sure how to use it for this purpose.
Can please someone help me on that ?
You should work with mouse events. I have not use this class. You need to check its code, see how to integrate mouse events inside the graph.
npatil15 last edited by
@dheerendra I Have tried with mouse move event, but its not smooth, but I want to click on line and then drag.
I'm not sure how you are handling the mouse & how qwt does. In general when you click on the line you need handle the mouseevent and change x, y of the line & call the update. This forces paintEvent(..) method to be called again.