+ Reply to Thread
Results 1 to 2 of 2

Thread: How to add/change text in a qwtlegend?

  1. #1
    Join Date
    Aug 2017
    Posts
    7
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default How to add/change text in a qwtlegend?

    Hi,

    I'm working on migrating a project which based on QWT 5.1 to QWT 6.2.
    I found the QwtLegendItem was removed in QWT6.2. I used setSymbol() and setText() to get the legend symbol/icon and legend text from my QwtLegend.

    I try to use QwtLegendLabel to get text, but there is not setSymbol() in QwtLegendLabel. Hence, I can't add any symbol/icon into my QwtLegendLabel object.

    So I plan to create a new Legend and change the its text directly.
    But how to change the text contents in a QwtLegend?

    Or how can I get the legend symbol/icon from a QwtLegend?

    Thanks a lot!

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

    Default Re: How to add/change text in a qwtlegend?

    Since Qwt 6 the information on the legend is more under control of the corresponding plot item. F.e the icon is created by QwtPlotItem::legendIcon(), what can be overloaded - like everything what finally ends up on the legend.

    If you provide more information about what exactly you need to achieve I can give more detailed hints.

    Uwe

+ Reply to Thread

Similar Threads

  1. Replies: 4
    Last Post: 19th July 2016, 19:10
  2. Replies: 0
    Last Post: 23rd February 2011, 16:36
  3. How to change the Label text
    By grsandeep85 in forum Qt Programming
    Replies: 2
    Last Post: 15th September 2009, 12:57
  4. Replies: 1
    Last Post: 23rd May 2008, 08:24
  5. Replies: 8
    Last Post: 15th May 2007, 09:21

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