Re: Linking QwtPlot panners
psk,
What you want may cause performance problem . Is that necessary ?
Re: Linking QwtPlot panners
Quote:
Originally Posted by
psk
I've been able to follow the rasterview example to allow panning of the plot. I've been trying to link the panners so that If I pan one plot, the other plots are moved as well.
The panner grabs the current content of the plot to a pixmap and creates a widget overlay, that is moving this pixmap without modifying the plot. The reason for this implementation is that that a user has a visual feedback without having to replot, what is often too slow for operations like panning.
If your application has plots, where replots are fast enough you might want to modify the real plot while scrolling/panning. F.e the eventFilter example shows how to scroll a plot with a QwtWheel - the code for several plots should be more or less the same.
If you want to implement "real" panning I would implement a event filter ( QObject::installEventFilter() ) for the plot canvas, that translates the mouse events into setAxisScale() calls. If you want to sync other plots according to scale changes of a plot you can connect to the QwtScaleWidget::scaleDivChanged() signal ( see QwtPlot::axisWidget() ).
HTH,
Uwe
Re: Linking QwtPlot panners
Thanks Nicho and Uwe for the clear explanation about the panner.
I'm having a go at what you've suggested Uwe. Update once I'm done (or stuck again)
Cheers,