Hi there. I looked through QWT docs but didn't find good example of how I can perform zooming: idea is simple - make zooming on QPushbutton pressEvent like one, which perform when I use a mousewheel.
Right now I use some buggy code like this:
Zoom in example
if (myPlot->axisEnabled(QwtPlot::yLeft))
{
QwtDoubleRect tempQwtRect(myPlotZoomer[0]->zoomRect());
tempQwtRect.setWidth(tempQwtRect.width()/1.1);
tempQwtRect.setHeight(tempQwtRect.height()/1.1);
myPlotZoomer[0]->zoom(tempQwtRect);
}
if (myPlot->axisEnabled(QwtPlot::yRight))
{
QwtDoubleRect tempQwtRect2(myPlotZoomer[1]->zoomRect());
tempQwtRect2.setWidth(tempQwtRect2.width()/1.1);
tempQwtRect2.setHeight(tempQwtRect2.height()/1.1);
myPlotZoomer[1]->zoom(tempQwtRect2);
}
but it goes downward and left form centre. Thanks for your answers beforehand.
Bookmarks