Results 1 to 4 of 4

Thread: QwtPlotZoomer not working for hidden axis

  1. #1
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QwtPlotZoomer not working for hidden axis

    For this project I'm working on I use the multiaxes QwtPlot, but I'm having a problem with the QwtPlotZoomer.

    When all the axes are visible (enabled by the legend) then zooming works like it should on all axes, but when I hide a axis then zoom and show that axis again the axis doesn't get zoomed properly?

    anyone know a solution for this?

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

    Default Re: QwtPlotZoomer not working for hidden axis

    A zoomer modifies the ranges of one x-axis and one y-axis - regardless if the corresponding axes are visible. Hide/Show of an axis doesn't have any impact on its range.
    So expect to find a bug in your code.

    Uwe

  3. #3
    Join Date
    May 2012
    Posts
    136
    Thanks
    2
    Thanked 27 Times in 24 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotZoomer not working for hidden axis

    The problem seems to occure when I do a full zoom out. the total zoom out triggers a re-enabling of autoscaling on the axes.
    In my data class I inherited the setRectOfInterest function, here I see the rect is different when the curve is hidden (see the axis rect marked with a *).
    Is there anything special in re-enabling autoscaling on a hidden curve?

    zoom out enabled
    rect of interest QRectF(0,-100 8499x200)
    rect of interest QRectF(0,-100 8499x200)
    rect of interest QRectF(0,-100 8499x200)
    *rect of interest QRectF(0,0 8499x300)

    zoom in enabled
    rect of interest QRectF(1996.67,-100.673 4026.19x51.1784)
    rect of interest QRectF(1996.67,-100.673 4026.19x51.1784)
    rect of interest QRectF(1996.67,-100.673 4026.19x51.1784)
    *rect of interest QRectF(1996.67,-1.0101 4026.19x76.7677)

    zoom out disabled
    rect of interest QRectF(0,-100 8499x200)
    rect of interest QRectF(0,-100 8499x200)
    rect of interest QRectF(0,-100 8499x200)
    *rect of interest QRectF(0,0 8499x1)

    zoom in disabled (as close as the zoom in when enabled, i was drawing the rect by hand)
    rect of interest QRectF(1997.17,-100.337 4006.94x50.1683)
    rect of interest QRectF(1997.17,-100.337 4006.94x50.1683)
    rect of interest QRectF(1997.17,-100.337 4006.94x50.1683)
    *rect of interest QRectF(1997.17,-0.0016835 4006.94x0.250842)

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

    Default Re: QwtPlotZoomer not working for hidden axis

    A full zoom out means, setting the axis scales to the ranges that are stored in the top element of the zoom stack of your zoomer.
    So what you need to find out is, when this first entry was added to the stack and why the range was bad in case of having a hidden axis.

    The methods where the first entry is initialized are the constructor or setZoomBase().

    HTH,
    Uwe

Similar Threads

  1. Replies: 4
    Last Post: 12th January 2016, 08:36
  2. Axis Title to axis label alignment
    By ROCKSTAR in forum Qwt
    Replies: 0
    Last Post: 5th February 2014, 13:47
  3. Replies: 3
    Last Post: 18th May 2011, 21:33
  4. Replies: 9
    Last Post: 3rd May 2011, 22:21
  5. widgets behind hidden widgets not working
    By bpetty in forum Newbie
    Replies: 13
    Last Post: 7th September 2007, 21:23

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.