Results 1 to 5 of 5

Thread: Does not work margin setting for title, class QwtTextLabel

  1. #1
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Does not work margin setting for title, class QwtTextLabel

    The default value is 0.
    For example change the value to 6 by call
    QwtPlot::titleLabel()->setMargin(6)
    there is such an effect (see screenshot)
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Does not work margin setting for title, class QwtTextLabel

    Indeed the margin is ignored in QwtPlotLayout leading to this effect. I would even say, that the whole QwtTextLabel::setMargin method is somehow obsolete as we have QWidget::setContentsMargins() since Qt4. But this is just a side note as using the contents margins is broken as well.

    I added the following bug reports:

    - https://sourceforge.net/p/qwt/bugs/243
    - https://sourceforge.net/p/qwt/bugs/242

    Uwe

  3. #3
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Does not work margin setting for title, class QwtTextLabel

    Uwe,

    This is a bug in the qt?
    I tried to set the margin for the QLabel in the Qt Designer, it works.

    Maybe the following functions are not implemented correctly?

    class QwtTextLabel:
    virtual QSize sizeHint() const;
    virtual QSize minimumSizeHint() const;
    virtual int heightForWidth( int ) const;

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Does not work margin setting for title, class QwtTextLabel

    Quote Originally Posted by atrofimov View Post
    This is a bug in the qt?
    No this is a Qwt bug - that's why it has been added to the Qwt bug tracker.

    Uwe

  5. #5
    Join Date
    Apr 2013
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Does not work margin setting for title, class QwtTextLabel

    It may be necessary to add functions
    void QwtPlot::setTitleLabel(QwtTextLabel *label)
    void QwtPlot::setFooterLabel(QwtTextLabel *label)

    ???

    To create a class based on QwtTextLabel.

Similar Threads

  1. Setting font for window/dialog title
    By rohitkk in forum Qt Programming
    Replies: 0
    Last Post: 21st March 2014, 05:18
  2. Replies: 5
    Last Post: 13th January 2014, 09:24
  3. Setting margin for drawText
    By waynew in forum Qt Programming
    Replies: 2
    Last Post: 6th September 2010, 16:58
  4. Setting layout margin and spacing globally
    By aarpon in forum Qt Programming
    Replies: 0
    Last Post: 7th April 2009, 12:23
  5. Setting the title bar
    By Krish_ng in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2007, 11:55

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.