Results 1 to 12 of 12

Thread: QwtPlot - Changing Title fonts

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot - Changing Title fonts

    Quote Originally Posted by Uwe View Post
    The size is an attribute of a QFont. How to assign a QFont is explained above.

    Uwe
    But in that case, setting the plot font to the same font as the rest of the widget, for example by:

    Qt Code:
    1. myPlot-> axisTitle(QwtPlot::xBottom).setFont(this -> font());
    To copy to clipboard, switch view to plain text mode 

    ... should result in the font size, as well as the font style, being synchronised. My axes titles are still in a much bigger font than everything else, however.

    What am I missing?

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

    Default Re: QwtPlot - Changing Title fonts

    QwtPlot::axisTitle() is a getter and it doesn't make much sense to assign something to an object, that is returned by value.

    Better do something like this:

    Qt Code:
    1. QwtText title("BlaBla");
    2. title.setFont(QFont("Helvetica", 20));
    3. plot->setAxisTitle(QwtPlot::yLeft, title);
    To copy to clipboard, switch view to plain text mode 

    Uwe

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

    Momergil (10th November 2013)

  4. #3
    Join Date
    Aug 2009
    Posts
    50
    Thanks
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot - Changing Title fonts

    Fantastic, that works! Thank you very much.

  5. #4
    Join Date
    Apr 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot - Changing Title fonts

    I've an additional question:
    how it is possible to change a plot legend font size? and, if possible, the dash size indicating the curve color?
    thanks

  6. #5
    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: QwtPlot - Changing Title fonts

    Isn't that a different question?

    Ressurecting so old thread isn't the best idea.
    Just create new thread so others can find it as well instead of using semi-related subject.

  7. #6
    Join Date
    Apr 2012
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot - Changing Title fonts

    Sorry,
    I've done it only beacause I've seen that somebody else did it before me (2007-2009)
    thanks for the advice.

Similar Threads

  1. Replies: 2
    Last Post: 12th April 2007, 11:11

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.