I think the point you might be missing is that the QwtPlot is simply a way to display and interact with your program's data. The data itself should be kept somewhere else so you can use it to implement the kind of user interface features you are describing.
I think you are right, so I tried to receive the Rect of the zoom area and then get back to the original data set:
void my2dPlot::enableZoomMode(bool on)
{
m_zoomer->setZoomBase();
m_zoomer->setEnabled(on);
m_zoomer->zoom(0);
d_picker->setEnabled(!on);
QwtDoubleRect rect;
rect = m_zoomer->zoomBase();
leftRange = rect.x();
rightRange = rect.right();
}
void my2dPlot::enableZoomMode(bool on)
{
m_zoomer->setZoomBase();
m_zoomer->setEnabled(on);
m_zoomer->zoom(0);
d_picker->setEnabled(!on);
QwtDoubleRect rect;
rect = m_zoomer->zoomBase();
leftRange = rect.x();
rightRange = rect.right();
}
To copy to clipboard, switch view to plain text mode
(leftRange,rightRange are double private members)
This part of code works correctly only when I click/unclick the enableZoomMode button (just like the bode example).
Is there a way to insert these lines
QwtDoubleRect rect;
rect = m_zoomer->zoomBase();
leftRange = rect.x();
rightRange = rect.right();
QwtDoubleRect rect;
rect = m_zoomer->zoomBase();
leftRange = rect.x();
rightRange = rect.right();
To copy to clipboard, switch view to plain text mode
in a different part of the code and get a realtime reaction?i.e. whenever I choose a zooming rect I get straight away the values of the rect stored?
Bookmarks