For the panner use QwtPlotPanner::setAxisEnabled( bool ).1. If my mouse is in the canvas, only the Y-axis should be zoomed.
- I think that shouldn't be a problem.
For the zoomer you need to have one x axis, but when you use only one of the simple assign the other one: f.e zoomer->setAxis( QwtPlot::xTop, ... );
Install an event filter for the axis widget: plot->axisWidget( QwtPlot::xBottom )->installEventFilter( ... );2. If my mouse is over the X-axis-label (time-label), only the X-axis should be zoomed.
- Here's my problem: How can I detect, that the mouse is hovering the X-axis-label?
- plot->axisWidget( QwtPlot::xBottom )->scaleDiv() returns the values of the ticks ( labels are on the major ticks )
- plot->axisWidget( QwtPlot::xBottom )->scaleDraw()->labelRect() calculates the bounding rectangle of a labels.
- plot->axisWidget( QwtPlot::xBottom )->scaleDraw()->scaleMap() translates widget coordinates ( f.e mouse clicks ) into plot coordinates and v.v.
HTH,
Uwe




Reply With Quote
Bookmarks