thanks buddy...
I have another problem
(as usual ...)
I have created mainwindow in Qt Designer and I have put a QwtPlot inside that mainwindow...
It gets created as 1000x1000(X x Y) plot...
When I attach some curves to it they get displayed nicely...with autoscale...
But I have implemented QwtZoomer as in examples:
{
public:
{
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
Qt::RightButton, Qt::ControlModifier);
Qt::RightButton);
}
};
class Zoomer: public QwtPlotZoomer
{
public:
Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas)
:QwtPlotZoomer(xAxis, yAxis, canvas)
{
setSelectionFlags(QwtPicker::DragSelection | QwtPicker::CornerToCorner);
setTrackerMode(QwtPicker::AlwaysOff);
setRubberBand(QwtPicker::NoRubberBand);
// RightButton: zoom out by 1
// Ctrl+RightButton: zoom out to full size
setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
}
};
To copy to clipboard, switch view to plain text mode
It is connected through the tool button(toggle) to this slot:
void MainWindow::enableZoomMode(bool on)
{
dataPanner->setEnabled(on);
dataZoomer[0]->setEnabled(on);
dataZoomer[0]->zoom(0);
dataZoomer[1]->setEnabled(on);
dataZoomer[1]->zoom(0);
dataPicker->setEnabled(!on);
}
void MainWindow::enableZoomMode(bool on)
{
dataPanner->setEnabled(on);
dataZoomer[0]->setEnabled(on);
dataZoomer[0]->zoom(0);
dataZoomer[1]->setEnabled(on);
dataZoomer[1]->zoom(0);
dataPicker->setEnabled(!on);
}
To copy to clipboard, switch view to plain text mode
The problem with this zoomer is that even when curves are displayed ok...when I toggle zoom button WHEN THE VALUES the curves display are small the curves are upon this toggle decreased too much so they are somwhere in the left corner of the plot...I think it is because the graph is initially created as 1000x1000 and zoom causes that somehow(since the max X values are 8 and max Y values are 10 )...So does anyone know how to make this work so the curves wouldnt decrease so much ?
Bookmarks