Results 1 to 9 of 9

Thread: QwtPlot Canvas Size Hint?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    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

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

    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?

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: QwtPlot Canvas Size Hint?


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

    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.

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    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

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

    pihentagy (25th February 2011)

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
  •  
Qt is a trademark of The Qt Company.