Results 1 to 9 of 9

Thread: QwtPlot Canvas Size Hint?

  1. #1
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtPlot Canvas Size Hint?

    Hi All,

    I have 3 QwtPlot in vertical layouted widget as you can from attached screenshot. When I zoomen in or out in my any canvas as you expect that scales changes so layout sizes changing too. Then my end-to-end alignment in each QwtPlot is breaking down.

    At this point, how can set my canvas size fixed. So my all 3 canvas left and right point lined up on same line.

    Thanks in advance.
    Regards.
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot Canvas Size Hint?

    If you are not looking for a dynamic solution, you can setMinimumExtent of the left side of the axis to a higher number.

    For example, p->axisScaleDraw ()->setMinimumExtent (80);

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

    umituzun84 (12th May 2010)

  4. #3
    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: QwtPlot Canvas Size Hint?

    And if you are looking for a dynamic solution use QwtScaleDraw::extent() from all left axes to calculate the value for the minimum extent.

    Uwe

  5. #4
    Join Date
    Feb 2011
    Location
    Hungary
    Posts
    4
    Thanks
    2
    Qt products
    Platforms
    Windows

    Default Re: QwtPlot Canvas Size Hint?

    In order to use extent(), one must know the currently used QFont and QPen.

    Figuring out the QFont is easy:
    Qt Code:
    1. self.plot.axisFont(axis)
    To copy to clipboard, switch view to plain text mode 
    , but how can I figure out the QPen used?

  6. #5
    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: QwtPlot Canvas Size Hint?


  7. #6
    Join Date
    Feb 2011
    Location
    Hungary
    Posts
    4
    Thanks
    2
    Qt products
    Platforms
    Windows

    Default Re: QwtPlot Canvas Size Hint?

    Thanks, but that seems qwt trunk version.
    QwtScaleDraw::extent takes 2 parameters (as of http://qwt.sourceforge.net/class_qwt...6501cc5ff290c6), and I do not know from where to get the QPen.

  8. #7
    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: QwtPlot Canvas Size Hint?

    Qt Code:
    1. QPen( Qt::color1, axisWidget(..)->penWidth() );
    To copy to clipboard, switch view to plain text mode 
    The color doesn't matter.

    Uwe

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

    pihentagy (25th February 2011)

  10. #8
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Multiple qwt plots?

    Hi I've 4 QwtPlots in a layout similar to u. I want to plot diffrent waves, but i am not able to plot diffrent waves. Its plotting the latest one in all 4 QwtPlots. Can u please help me solving this. Thanks in advance

    Kishore

  11. #9
    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: Multiple qwt plots?

    Maybe you're setting the same data on all the plots?

    Show some code then it'll be easier to say.

Similar Threads

  1. Replies: 0
    Last Post: 4th May 2010, 10:45
  2. Replies: 2
    Last Post: 28th October 2009, 00:02
  3. Replies: 1
    Last Post: 29th November 2008, 13:37
  4. hint on OO
    By mickey in forum General Programming
    Replies: 7
    Last Post: 7th July 2006, 14:38
  5. QDockArea size hint
    By ksierens in forum Qt Programming
    Replies: 2
    Last Post: 5th April 2006, 16:37

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.