PDA

View Full Version : zooming and moving marker



temis
21st July 2012, 17:16
I'm trying to implement in a plot these behaviours:

left click: move a vertical marker to the clicked position
left click and move: move the marker following the mouse
right click: show a context menu with a zoom voice (not enabled in this case)
right click and move: drag a selection and once that the right mouse is relased open the context menu with the zoom voice (which now are enabled)

I know that I need to use QwtPlotPicker, QwtPlotMarker and QwtPlotZoomer but I don't know how.
Thanks in advice for the help

Uwe
25th July 2012, 00:15
left click: move a vertical marker to the clicked position
This is a picker with a QwtPickerClickPointMachine. Simply modify the position of the marker according to the selected() signal.

left click and move: move the marker following the mouse
This is a picker with a QwtPickerDragPointMachine and a vertical line as rubberband. Hide the marker according to the activated() signal and show it at its new position according to the selected() signal.

To avoid conflicts this picker should also handle your first use case.

Uwe

temis
26th July 2012, 16:59
Is it possible to do this with only one picker with a QwtPickerDragPointMachine and a vertical line as a rubberband in this way:
Set and show the marker according to the selected signal
Hide the marker according to the moved signal