Results 1 to 3 of 3

Thread: Controlling the margin of a QwtPolarPlot

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Controlling the margin of a QwtPolarPlot

    Hello!

    Screenshot from 2014-07-16 14:29:37.png

    In the above image one can see that there is big wasted spaces between the actual QwtPolarPlot and its background "widget". My question is: how can I control that so I may make those margins be thinner? I couldn't find any method in QwtPolarPlot to control such margins


    Thanks,

    Momergil
    May the Lord be with you. Always.

  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: Controlling the margin of a QwtPolarPlot

    First of all you can set the contents margins ( see QWidget::setContentsMargins(). The radius of the plot canvas is then calculated in QwtPolarPlot::plotRect().

    Another factor might be the value, that is returned from QwtPolarGrid::marginHint(). This margin depends on the width for the tick labels and could be optimized for a plot like yours.

    Uwe

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

    Momergil (17th July 2014)

  4. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Controlling the margin of a QwtPolarPlot

    Thanks Uwe. QWidget::setContentsMargins() did the trick (although using negative values for such method sounds strange to say the least!)

    Momergil
    May the Lord be with you. Always.

Similar Threads

  1. Drawing lines on qwtpolarplot
    By jerrychan in forum Qwt
    Replies: 3
    Last Post: 12th June 2013, 10:55
  2. QwtPolarPlot questions
    By Galabis in forum Qwt
    Replies: 4
    Last Post: 28th June 2012, 06:16
  3. Animating a QwtPolarPlot
    By bwnicewo in forum Qwt
    Replies: 5
    Last Post: 14th June 2012, 15:38
  4. Animating a QwtPolarPlot
    By bwnicewo in forum Qt Programming
    Replies: 0
    Last Post: 8th June 2012, 17:54

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.