PDA

View Full Version : Using QwtPlotMagnifier on plot axes



cesroc
13th May 2013, 08:33
Hello,
I'm trying to use QwtPlotMagnifier to perform a zoom in/out, it works fine using mouse wheel on the plot area, but I would like to activate and use mouse wheel only when the user is with the mouse on the y axes.
For example, if the user wants to zoom the y-axis he brings the mouse on the y-axis and then uses the mouse wheel and not on the plot area. How can I install this event on the axes to get the mouse wheel? I have no idea, not even how to start to implement that, any help will be perfect. When the software starts the magnifier can be already started for y axes, but it will zoom only when the wheel is used on the y-axes and not on the whole plotting area.

It's difficult to explain, I hope someone understood and can help me.
Thanks in advance.
Regards,
Cesar Rocha

Seamus
13th May 2013, 13:53
I don't believe you can use QwtPlotMagnifier for this. Create a new class, install event filter on QwtPlot::axisWidget(), filter wheel events, calculate axis scale, then lastly QwtPlot::setAxisScale(). You may be able to make use of QwtMagnifier, if you don't want to do the calculations.