I use a QwtPlotPanner to move on the canvas with the left Button. Is it possible to move through the canvas with the arrow keys on my keyboard?.
You would have to overload QwtPlotPanner overloading the key event handling. But usually you want to do one of the following:
void shiftAxis
( QwtPlot* plot,
int axis,
double increment
) {
QwtInterval interval = plot->axisInterval( axis );
plot->setAxisScale( axis, interval.minValue() + increment, interval.maxValue() + increment );
}
void shiftAxis
( QwtPlot* plot,
int axis, in numPixels
) {
QwtInterval interval = plot->axisInterval( axis );
double min = map.invTransform( map.transform( interval.minValue() ) + numPixels );
double max = map.invTransform( map.transform( interval.maxValue() ) + numPixels );
plot->setAxisScale( min, max );
}
void shiftAxis( QwtPlot* plot, int axis, double increment )
{
QwtInterval interval = plot->axisInterval( axis );
plot->setAxisScale( axis, interval.minValue() + increment, interval.maxValue() + increment );
}
void shiftAxis( QwtPlot* plot, int axis, in numPixels )
{
QwtScaleMap map = plot->canvasMap( axis );
QwtInterval interval = plot->axisInterval( axis );
double min = map.invTransform( map.transform( interval.minValue() ) + numPixels );
double max = map.invTransform( map.transform( interval.maxValue() ) + numPixels );
plot->setAxisScale( min, max );
}
To copy to clipboard, switch view to plain text mode
Can I set something like a limit on my axis, so the user can't move away from the curves?
You would have to overload QwtPlotPanner::moveCanvas().
I want to set two VLineRubberBand which I can move through the graph. I can do this with a QwtPlotPicker, but how do I leave the RubberBand on a certain position?
Insert 2 markers ( QwtPlotMarker::VLine ) and hide them, when the corresponding picker is active.
Uwe
Bookmarks