Results 1 to 3 of 3

Thread: Changing the font size and the color of QwtPlot scale labels

Hybrid View

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

    Default Re: Changing the font size and the color of QwtPlot scale labels

    The colors of the axes depends on the palette of the scale widget: QPalette::Text is used for the labels, QPalette::Foreground ( = QPalette::WindowText ) for ticks and backbone.
    You can overrule the widget palette by overloading QwtAbstractScaleDraw::label(), where you can set individual colors for each tick label.

    For your use case I would simply do something like "plot->setPalette( Qt::darkGray );". The constructor of QPalette will create colors with good contrasts and all scale widgets inherit the palette from the plot.

    Concerning the font of the tick labels: "plot->axisWidget( ... )->setFont( ... );" Note, that the font can also be overruled in a similar way like the colors.

    Uwe

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

    Momergil (4th December 2014)

Similar Threads

  1. Space between scale and labels in qwtPLot
    By hassinoss in forum Qwt
    Replies: 3
    Last Post: 20th May 2014, 06:41
  2. Replies: 1
    Last Post: 30th March 2012, 16:46
  3. QLabel Font size is not changing???
    By Gokulnathvc in forum Newbie
    Replies: 4
    Last Post: 22nd March 2011, 11:17
  4. Qt Designer Platform specific font size for labels
    By abey in forum Qt Tools
    Replies: 0
    Last Post: 16th February 2011, 16:21
  5. How to re-scale or changing the size of a QGrapicsScene
    By KristianKarl in forum Qt Programming
    Replies: 2
    Last Post: 9th August 2010, 17:34

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.