Results 1 to 5 of 5

Thread: Sorry - more QwtPlotZoomer questions

  1. #1
    Join Date
    May 2008
    Posts
    25
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Sorry - more QwtPlotZoomer questions

    Hi,

    I continue to have a little difficulty with the plot zoomers. I am using the same plot to display either time or distance data. The x Scales for these are completely different, i.e. distance 0 - 30 and time 0 - 3e-6s.

    As such, I display them at different times, i.e. not on the same plot.

    After each curve is plotted to the QwtPlot, I call pZoom->setZoomBase(). Then when I switch from time to distance, I clear the plot and destroy the old zoomer, then create a new one. Plot the distance curve and call pZoom->setZoomBase() again.

    To my understanding, this should clear all the window conditions and reset the zoomer. However, when this happens, the plot retains the zoom base of the original time plot, i.e. xBottom 0- 3us and yLeft at the previous conditions.

    Am I doing something stupid? I thought clear() did the job in the Plot and the destruction of the zoomer, would wipe out anything else.

    Robbie

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

    Default Re: Sorry - more QwtPlotZoomer questions

    Zooming in assigns scales explicitly and turns autoscaling off. If you want to have autoscaling later again you need to re-enable it.

    Uwe

  3. #3
    Join Date
    May 2008
    Posts
    25
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sorry - more QwtPlotZoomer questions

    Thanks Uwe, good to know. Hopefully this will sort out a raft of problems....

  4. #4
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sorry - more QwtPlotZoomer questions

    Quote Originally Posted by cnbp173 View Post
    Hi,

    I continue to have a little difficulty with the plot zoomers. I am using the same plot to display either time or distance data. The x Scales for these are completely different, i.e. distance 0 - 30 and time 0 - 3e-6s.

    As such, I display them at different times, i.e. not on the same plot.

    After each curve is plotted to the QwtPlot, I call pZoom->setZoomBase(). Then when I switch from time to distance, I clear the plot and destroy the old zoomer, then create a new one. Plot the distance curve and call pZoom->setZoomBase() again.

    To my understanding, this should clear all the window conditions and reset the zoomer. However, when this happens, the plot retains the zoom base of the original time plot, i.e. xBottom 0- 3us and yLeft at the previous conditions.

    Am I doing something stupid? I thought clear() did the job in the Plot and the destruction of the zoomer, would wipe out anything else.

    Robbie
    Coincidently this is exactly what i want to do, use one plot to display two separate ranges of data at separate times.

    Do you actually need to destroy the old zoomer and create a new one, can it not be detatched or kept disabled, or is the effort of creating simple enough to not warrent worrying about it. Basically the plot for me will change when user selects between a tab widget on a separate docked widget next to the plot area.

  5. #5
    Join Date
    Jan 2010
    Posts
    28
    Thanks
    4
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Sorry - more QwtPlotZoomer questions

    I have had some success with my implementation of switching zoomers on two distictly different plots by creating just a single zoomer per QwtPlot and then dumping or reloading the zoom stack from the zoomer with zoomStack() and setZoomStack() when I switch plots. I still have to sort out the zoom initialisation code but this approach looks promising and saves deleting and recreating zoomers.

Similar Threads

  1. Replies: 3
    Last Post: 10th October 2011, 17:55
  2. Replies: 28
    Last Post: 9th March 2010, 09:59
  3. QwtPlotZoomer, using two zoomers.
    By jma in forum Qwt
    Replies: 2
    Last Post: 30th September 2008, 09:29
  4. Replies: 1
    Last Post: 25th August 2008, 21:49
  5. Problem with QwtPlotZoomer
    By seguprasad in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2007, 09:31

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.