Hello,
I don't know if someone else had this problem, at least I didn't find a solution yet.
I created a zoomer in my application, but when I create the polygon to zoom-in I need to get the new x-axis and y-axis that's been showed in my plot. I can get all the curve points, but it's not right, I need to know just the points that's been displayed. With the code below I create the zoomer:
zoomer
= new QwtPlotZoomer(QwtPlot::xBottom, channelSelection
->currentIndex
(),plot.
at(graphAreaSelection
->currentIndex
())->canvas
() );
plot.at(graphAreaSelection->currentIndex())->setCanvasBackground(Qt::white);
zoomer
->setRubberBandPen
( QColor( Qt
::black ) );
zoomer
->setTrackerPen
( QColor( Qt
::black ) );
zoomer
->setMousePattern
( QwtEventPattern::MouseSelect2,Qt
::RightButton, Qt
::ControlModifier );
connect(zoomer,
SIGNAL(selected
(QPolygon )),
this,
SLOT(autoRescale
(QPolygon )));
zoomer = new QwtPlotZoomer(QwtPlot::xBottom, channelSelection->currentIndex(),plot.at(graphAreaSelection->currentIndex())->canvas() );
plot.at(graphAreaSelection->currentIndex())->setCanvasBackground(Qt::white);
zoomer->setRubberBandPen( QColor( Qt::black ) );
zoomer->setTrackerPen( QColor( Qt::black ) );
zoomer->setMousePattern( QwtEventPattern::MouseSelect2,Qt::RightButton, Qt::ControlModifier );
zoomer->setMousePattern( QwtEventPattern::MouseSelect3,Qt::RightButton );
connect(zoomer, SIGNAL(selected(QPolygon )), this, SLOT(autoRescale(QPolygon )));
To copy to clipboard, switch view to plain text mode
With this connect I can know when the user created the polygon to perform the zoom-in, inside of my autoRescale I can get the polygon using:
zoomer->selection();
zoomer->selection();
To copy to clipboard, switch view to plain text mode
I think this polygon I get with selection() is my new plot area, am I right? If I'm right, how can I convert this polygon to coordinates? Because with the coordinates I can find how many points is been showed.
I hope someone can understand me, it's hard to explain.
Thanks
Bookmarks