Results 1 to 6 of 6

Thread: Static scaleDivs on Form.resize

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Static scaleDivs on Form.resize

    Hi all again. Could you, please, help me?

    For default QwtPlot changes (curve xy values/pixels) proportian.

    So if I, for example, have form with size of 600x600 pixels and y scale of plot has values from 100 to 200 than i resize from to full extent or to 600x800 pixels y scale still will show values from 100 to 200 (curves will redraw accordingly of course). For me is better to set static proportion -> in this example yscale will show ~75 to 200 and curves will be same.

    Is it possible to switch to this mode just changing some parameters in plot or zoomer or it's more complicated?

    Sorry if I described things not so clearly.

  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: Static scaleDivs on Form.resize

    In the 5.2 development branch ( = trunk ) you find a class QwtPlotRescaler, that does what you need. The navigation example shows how to use it.

    It's long ago since I wrote this class, but AFAIR it is compatible with 5.0. So I guess you can simply copy the class to your source tree.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    KosyakOFF (25th April 2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

    Thumbs up Re: Static scaleDivs on Form.resize

    Thanks again!
    Last edited by KosyakOFF; 25th April 2008 at 13:30. Reason: user request

  5. #4
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Static scaleDivs on Form.resize

    By the way, how can I switch form of scale values from exponential (-8.33E4) to standart mode (-83300.0)?

  6. #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: Static scaleDivs on Form.resize

    You have to overload QwtScaleDraw::label(double value) const;

    Uwe

  7. The following user says thank you to Uwe for this useful post:

    KosyakOFF (8th May 2008)

  8. #6
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Static scaleDivs on Form.resize

    Thanks again =)

Similar Threads

  1. Replies: 16
    Last Post: 23rd May 2008, 10:12
  2. static declaration
    By jhearon in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2008, 21:37
  3. Accessing to a static variable from the same class
    By xgoan in forum General Programming
    Replies: 6
    Last Post: 5th March 2007, 10:50

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.