QCustomPlot Discussion and Comments

Drag / mouse moveReturn to overview


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

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

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