Results 1 to 2 of 2

Thread: How to get a QwtLegendLabel from a QwtPlotItem(such as QwtPlotCurve)?

  1. #1
    Join Date
    Feb 2014
    Posts
    28
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How to get a QwtLegendLabel from a QwtPlotItem(such as QwtPlotCurve)?

    Hello everyone, In Qwt6.0, I can use QwtLegend::find(const* QwtPlotItem) to get a pointer of QwtLegendItem, but in 6.1, QwtLegendItem is replaced with QwtLegendLabel, and QwtLegend::find() is removed. What should I do when I want to get a pointer of QwtLegendLabel which is related to a QwtPlotItem? And how can I get all QwtLegendLabels from a QwtLegend?

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

    Default Re: How to get a QwtLegendLabel from a QwtPlotItem(such as QwtPlotCurve)?

    F.e in the cpuplot example ( CpuPlot::showCurve ) you can find the sequence how to get the label.
    The complete list can be found by iterating over the plot items - or maybe easier by plot->legend()->findChildren<QwtLegendLabel>();

    This odd API is somehow the price, that needs to paid for being able to replace QwtLegend by any other type of widget.

    Uwe

Similar Threads

  1. More information about QwtLegendLabel
    By Sangfeust in forum Qwt
    Replies: 2
    Last Post: 9th February 2015, 09:46
  2. Replies: 1
    Last Post: 19th September 2014, 08:56
  3. Replies: 8
    Last Post: 9th February 2014, 12:37
  4. Replies: 8
    Last Post: 18th October 2012, 07:23
  5. Replies: 1
    Last Post: 11th May 2012, 08:02

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.