Results 1 to 7 of 7

Thread: Replicate zoomer functionality offered by qwtplot

  1. #1
    Join Date
    Jan 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Replicate zoomer functionality offered by qwtplot

    Hi All,

    I wish to replicate the zoomer functionality of the qwtplot in my own application but I do not wish to use the entire qwt library due to some performance related issues.

    What I have tried to do :

    I have taken some of the examples provided with the qwt package containing the zoomer functionality in debug and tried to observe what all is happening after the zoomer object is being created. Somehow I am getting lost somewhere in the middle and have to restart again.

    What I want to achieve

    I want to reuse only that part of the code (only the classes and methods from qwt library) that are required for the zoomer functionality. Is my approach the only way to do that? Or is there any other faster more efficient way how I can achieve that.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    The zoomer doesn't make sense out of the context of the QwtPlot framework + there are no performance related issues with Qwt .

    Uwe

  3. #3
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    What performance issues you're refering to?

  4. #4
    Join Date
    Jan 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    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??

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    Quote Originally Posted by xenonforlife View Post
    How in your opinion should I proceed??
    Talk to your project coordinator - his advice doesn't make much sense.

    Uwe

  6. #6
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    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

  7. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Replicate zoomer functionality offered by qwtplot

    Quote Originally Posted by FelixB View Post
    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.
    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

Similar Threads

  1. Qt Software development offered
    By sujan.dasmahapatra in forum Resumes
    Replies: 0
    Last Post: 2nd August 2011, 18:09
  2. Replies: 2
    Last Post: 20th April 2011, 12:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.