Results 1 to 4 of 4

Thread: How to retain zoomed view in QwtPlot while keeping aspect ratio and resizing chart

  1. #1
    Join Date
    Dec 2008
    Location
    California, USA
    Posts
    18
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default How to retain zoomed view in QwtPlot while keeping aspect ratio and resizing chart

    Hi, can anyone give me a hint on how to retain a zoomed view in QwtPlot while keeping aspect ratio and resizing chart. I've been experimenting with the rescaler example in Qwt playground, but can't get it to work.

    Thanks

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

    Default Re: How to retain zoomed view in QwtPlot while keeping aspect ratio and resizing char

    Quote Originally Posted by EliGri View Post
    Hi, can anyone give me a hint on how to retain a zoomed view in QwtPlot while keeping aspect ratio and resizing chart.
    There is no solution - when the width/height ratio of the canvas geometry changes you have to adjust the zoomed view or you lose the aspect ratio.
    QwtPlotRescaler offers some standard strategies for adjusting the scales according to the canvas geometry.

    But I guess you already knew this - so what exactly is your question now ( "can't get it to work" might be anything ) ?

    Uwe

  3. #3
    Join Date
    Dec 2008
    Location
    California, USA
    Posts
    18
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to retain zoomed view in QwtPlot while keeping aspect ratio and resizing char

    Thanks Uwe, I see your point. I'm not making aspect ratio adjustments to the zoomed view. I'll work on that.

    But once I get that working, and I'm keeping the aspect ratio during zoom, how can I retain that zoomed view after a resize event occurs?
    Right now (after a resize), the canvas always reverts back to the original, unzoomed view. Is this because, currently, my zoom views are "unadjusted" and aspect ratio has been lost?

  4. #4
    Join Date
    Dec 2008
    Location
    California, USA
    Posts
    18
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to retain zoomed view in QwtPlot while keeping aspect ratio and resizing char

    Uwe, I think I’ve solved our aspect ratio issue for now. Rather than setting the QwtPlotRescaler rescalePolicy to “Fitting”, I’ve reverted back to using a rescalePolicy of “Fixed”.
    It’s not a perfect solution for this particular implementation of QwtPlot, but it’s a lot easier to implement and it will due for now.

    Thank you.

Similar Threads

  1. QCameraViewfinder aspect ratio
    By gpuckett in forum Qt Programming
    Replies: 0
    Last Post: 29th May 2014, 19:52
  2. Replies: 2
    Last Post: 7th December 2013, 19:02
  3. QMdiSubWindow maintaining aspect ratio while resizing ?
    By Abhishek Bansal in forum Newbie
    Replies: 0
    Last Post: 9th October 2012, 16:36
  4. Replies: 2
    Last Post: 20th April 2011, 12:47
  5. keeping aspect ratio while resizing
    By franco.amato in forum Qt Programming
    Replies: 2
    Last Post: 19th November 2009, 20:12

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.