What performance issues you're refering to?
What performance issues you're refering to?
I am currently working on a project where we are currently using the qwt library, but our project coordinator wishes to remove the dependency on qwt and replicate just the functionality we require from qwt.
Now I am just a beginner in Qt development and am getting pretty lost when looking at how the zoomer object is working on the image. I have myself set a task of simply displaying an image in a window and having a zoomer button which enables zooming. now if I select a part of the image that part should be zoomed into and it should zoom out one step back on clicking the right mouse button similiar to the case in the Qwtplot zoomer functionality. How in your opinion should I proceed??
basically, the concept of a zoomer is simple. you have to store the coordinates of the zoomed areas in a stack. when you zoom in, you push the new coordinates. when you zoom out, you pop the topmost element and set the coordinates of the new top element.
How you do the "get current coordinates" and "zoom", depends on your implementation of the plot.
Why does your project coordinator wants to remove the dependency?
Felix
Yes, but I guess xenonforlife means the complete functionality - including the base classes of QwtPlotZoomer:
- QwtPicker offers an implementation how to select rectangles ( or other shapes, that you don't need for zooming ) on any kind of QWidget. It implements the overlay widgets for the rubberband and the tracker text, what is probably something you can't implement without deeper understanding of Qt. QwtPicker doesn't depend on the QwtPlot framework and can easily copied out and used without the Qwt librarary.
- QwtPlotPicker adds all what is related to the transformation between plot and widget coordinates. As this transformation is completely QwtPlot specific this class doesn't make sense to be used out of the QwtPlot context.
- QwtPlotZoomer translates the selected rectangles into changes of the axes scales - what again doesn't make any sense without using QwtPlot. It also implement a history of zoom rectangles ( the zoom stack ) and how to navigate over the history. This is something you could do the same way in a homebrew plot widget. But this is more or less trivial, so that you can implement it in a couple of minutes yourself.
Note, that copying code from Qwt has the same license implications as using Qwt !
Uwe
Bookmarks