QCustomPlot Discussion and Comments

Drag / mouse moveReturn to overview

Hi,

I have two event handler:

mousePressEvent(QMouseEvent* Event){...}
mouseMoveEvent(QMouseEvent* Event){...}

and I want to drag my plot by pressing the left mouse button down, hold it and move the mouse.
In mouseMoveEvent() I coded

setInteractions(QCP::iRangeDrag);
axisRect(0)->setRangeDragAxes(xAxis, yAxis);

However, if I donĀ“t use these event handlers, dragging works fine. As soon as I implement them, dragging somehow is disabled. Am I missing something?

Solved problem on my own. I just called

QCustomPlot::mousePressEvent(Event) and
QCustomPlot::mouseMoveEvent(Event)

at the end of my implementations of mousePressEvent(...) and mouseMoveEvent(...).

Additionally I call

setRangeDrag(Qt::Horizontal | Qt::Vertical)

explicitly each time in the event methods. This ensures I can switch between states like zooming and dragging. I just need to implement an eventHandler function which handles that for me. ;-)

can u send me the code??

can u send the code..
thanks in advence