Results 1 to 4 of 4

Thread: Can I change the text color in my legend to match the curve color?

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: Can I change the text color in my legend to match the curve color?

    The legend is a container widget around a scrollview, that contains another containter widget (QwtLegend::contentsWidget()), with the legend item widgets inside.

    If you want to find the legend item widget, that corresponds to a specific plot item ( f.e for assigning the color of the curve to its palette ) you can use QwtLegend::find ( QwtPlotItem is derived from QwtLegendItemManager ). Overloading QwtPlotItem::updateLegend() is the place to do this.

    If you want to have your own type of widget (instead of QwtLegendItem) to be displayed on the legend, implement YourCurve::legendItem() and YourCurve::updateLegend().

    Uwe

    PS: Qwt is open source - why not looking into the code to identify the internal widget trees.

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

    AwareWolf (22nd January 2010)

Similar Threads

  1. change text color on QRadioButton
    By vonCZ in forum Newbie
    Replies: 4
    Last Post: 7th November 2012, 20:05
  2. How to change text color of push button?
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2009, 10:32
  3. how to change backgroup color, button color and shape?
    By lzha022 in forum Qt Programming
    Replies: 10
    Last Post: 16th June 2008, 22:25
  4. how to change text color in QTableView?
    By phillip_Qt in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:03
  5. Change the text color tab page
    By gtthang in forum Qt Programming
    Replies: 4
    Last Post: 18th February 2006, 17:38

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.