Results 1 to 2 of 2

Thread: Qwt scale widget setSpacing problem

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qwt scale widget setSpacing problem

    hi friends,
    SetSpacing in QWtScaleWidget and SetSpacing in QwtScaleDraw is shrinking the Canvas size , when increasing the value. my requirement is the title and the scale distance from the Axis should increase and canvas style should remain same.

    i tried
    QwtScaleDraw::setSpacing(int) for distance between axis and label and QwtScaleWidget::setSpacing(int) for distance between axis and title.

    but when i increase the value, the space is provided by shrinking the Canvas rect.

    my requirement is to keep the rect stable and the title and label should move away from the axis.

    Please help me,

    Thanks in advance.
    "Behind every great fortune lies a crime" - Balzac

  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: Qwt scale widget setSpacing problem

    Quote Originally Posted by wagmare View Post
    SetSpacing in QWtScaleWidget and SetSpacing in QwtScaleDraw is shrinking the Canvas size ...
    This is a problem of the layout, where the plot widget is in. If you are increasing the space needed for the scales and you don't want the canvas to shrink, then the plot widget needs to get more space.

    In case the geometry of the plot is under control of a QLayout you could try to overload QwtPlot::sizeHint(), using an implementation, where the value is directly related to your spacings. Of course you also would have to choose a sizePolicy, where the layout is not ignoring the hint.

    Uwe

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

    wagmare (21st April 2016)

Similar Threads

  1. Adding marker to scale widget
    By SeanM in forum Qwt
    Replies: 3
    Last Post: 18th August 2014, 19:47
  2. Rendering a scale widget
    By moijhd in forum Qwt
    Replies: 5
    Last Post: 31st July 2013, 06:43
  3. scale painter to fit my widget
    By jesse_mark in forum Qt Programming
    Replies: 18
    Last Post: 6th June 2013, 17:03
  4. Scale a widget
    By yagabey in forum Qt Programming
    Replies: 2
    Last Post: 7th December 2008, 13:08
  5. My own scale widget in Qwt
    By igrms in forum Qwt
    Replies: 7
    Last Post: 15th June 2006, 21:18

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.