PDA

View Full Version : Moving plot marker with the mouse



viridis
28th August 2008, 13:21
Hi,

I want to move a QwtPlotMarker (vertical) when I click on it, and move it while the mouse button is down. Of course, the marker should follow the mouse cursor.

What is the easiest way to achieve this ?

Regards,

Uwe
11th September 2008, 10:25
I would implement it as a combination of a QwtPlotMarker and a QwtPlotPicker.

Uwe

matejkenda
23rd September 2008, 21:39
Hi Uwe, I am trying to achieve exactly the same thing, however I'm quite new to Qwt and I need more help.

Can you please give me a few hints about how to set up the picker to display the vertical movement marker and to emit the event after the movement is complete?


m_picker = new QwtPlotPicker(m_amp->canvas());
m_picker->setTrackerMode(QwtPicker::AlwaysOn);
m_picker->setRubberBand(QwtPicker::VLineRubberBand);
m_picker->setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection);
connect(m_picker, SIGNAL(selected(const QwtDoublePoint&)), this, SLOT(Clicked(const QwtDoublePoint&)) );