Results 1 to 2 of 2

Thread: How to change appearance of a legend item?

  1. #1
    Join Date
    Nov 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to change appearance of a legend item?

    I have implemented my own plot curve class which generates a specialized legend item in legendItem(). Now I want to change the item text/color/label on certain events. E.g. I want to add a "inactive" text to the curve title and/or I want to change the symbol/color.

    There is a virtual method QwtPlotCurve::updateLegend(). It is called when a legend is inserted into the plot, but I don't know how to trigger it manually. The documentation of updateLegend() is very short and the method is not used in any example project.

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

    Default Re: How to change appearance of a legend item?

    Call curve->itemChanged() whenever you want to update the representation on the legend( updateLegend() will be triggered. ).

    Uwe

    PS: Qwt is open source - why not looking into the source code to see what's going on ?

Similar Threads

  1. Replies: 3
    Last Post: 22nd January 2010, 17:46
  2. Replies: 1
    Last Post: 7th October 2008, 13:11
  3. Replies: 8
    Last Post: 15th May 2007, 10:21
  4. Can't change the text display of a QTreeview item.
    By johnny_sparx in forum Qt Programming
    Replies: 3
    Last Post: 2nd June 2006, 02:03
  5. how change the QListBox item position by pixel
    By roy_skyx in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 02:34

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.