Results 1 to 3 of 3

Thread: More information about QwtLegendLabel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2015
    Posts
    6
    Qt products
    Qt5
    Platforms
    Windows

    Default More information about QwtLegendLabel

    Hello,

    I am using the legend to show/hide my curve and it works fine.

    But I am looking for a way to set the QwtLegendLabel of the curve to SET when attached to the plot...

    Can someone help me?
    I have not find how to reach easyli QwtLegendLabel of a curve...

    I use this to show/hide:
    Qt Code:
    1. void GraphB::showCurve( QwtPlotItem *item, bool on )
    2. {
    3. // Show/hide the curve
    4. item->setVisible( on );
    5.  
    6. // Get QwtLegend .... but why
    7. QwtLegend *lgd = qobject_cast<QwtLegend *>( legend() );
    8.  
    9. // List of widget from QwtLegend associate to item
    10. QList<QWidget *> legendWidgets =
    11. lgd->legendWidgets( itemToInfo( item ) );
    12.  
    13. // ????
    14. if ( legendWidgets.size() == 1 )
    15. {
    16. // legendLabel is the frame of the legend label
    17. QwtLegendLabel *legendLabel =
    18. qobject_cast<QwtLegendLabel *>( legendWidgets[0] );
    19.  
    20. // If we have the object check it
    21. if ( legendLabel )
    22. legendLabel->setChecked( on );
    23. }
    24.  
    25. replot();
    26. }
    To copy to clipboard, switch view to plain text mode 

    I am also looking for a method to hide the yAxis of the QwtPlotCurve... if someone has already done something

    Thanks
    Sangfeust
    Last edited by Sangfeust; 5th February 2015 at 14:47.

Similar Threads

  1. Replies: 1
    Last Post: 19th September 2014, 08:56
  2. Replies: 14
    Last Post: 27th November 2011, 14:13
  3. Information regarding QFile
    By Raghaw in forum Qt Programming
    Replies: 2
    Last Post: 12th October 2010, 16:32
  4. QT app information
    By CHeader in forum Qt Programming
    Replies: 5
    Last Post: 4th April 2008, 11:07
  5. Getting MAC Information from qt?
    By vishal.chauhan in forum Qt Programming
    Replies: 4
    Last Post: 23rd May 2007, 09:31

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.