Results 1 to 4 of 4

Thread: How to display external legends in Qwt?

  1. #1
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default How to display external legends in Qwt?

    Hi everyone,

    I'm trying to create a plot with an external legends. I looked forward some simple instructions which show me the way.

    I know that after configuring the legends, I have to use this instruction:

    Qt Code:
    1. insertLegend(d_legend, QwtPlot::ExternalLegend);
    To copy to clipboard, switch view to plain text mode 

    but I couldn't find a way to show them say in layout. Usually people say use printlegend (or something) to do that. I tried but it was unsuccessful

    Would you please send me a simple piece of code which shows how to do that?
    Consider that my plot name is Plot and put the legend in a layout named HLayout.

    Thanks

  2. #2
    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: How to display external legends in Qwt?

    QwtLegend is a widget like any other widget and an external legend can be put into any Qt Layout. This is too trivial for posting code !

    Only when you want to print or export your plot together with an external legend to a document you have to calculate the target rectangles for plot and legend on your own. Then use QwtPlot::print + QwtPlot::printLegend.

    Uwe

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: How to display external legends in Qwt?

    Uwe,

    Thank you for the response,

    I'd seen the solution before, but my problem is the is no print or printLegend member in the QwtPlot class (or I am more than beginner that I can not find them ). That's why I reqested a peice of code.

  4. #4
    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: How to display external legends in Qwt?

    Then you are using Qwt 6.x and have to check QwtPlotRenderer.

    Uwe

Similar Threads

  1. How to display external legends in Qwt?
    By saliemam in forum Newbie
    Replies: 0
    Last Post: 1st December 2010, 03:33
  2. How to Display only external devices in QtFiledialog
    By vjsharma_30 in forum Qt Programming
    Replies: 6
    Last Post: 18th February 2010, 19:27
  3. Qwt: How to create legends inside plots ?
    By Comer352l in forum Qwt
    Replies: 5
    Last Post: 16th August 2009, 18:02
  4. Remove Legend items, move legends
    By giusepped in forum Qwt
    Replies: 0
    Last Post: 11th February 2009, 02:35
  5. Replies: 2
    Last Post: 14th January 2008, 18:09

Tags for this Thread

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.