Results 1 to 2 of 2

Thread: QwtLegend orientation on QwtPlot

  1. #1
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QwtLegend orientation on QwtPlot

    I've created a multi-curve QwtPlot with a legend as a child of the canvas at the top, but the legend items are all strung out on a single line across the top of the plot.

    // add a legend
    QwtLegend* legend = new QwtLegend();
    legend->setParent( canvas() );
    insertLegend( legend, QwtPlot::ExternalLegend );

    I'd like to see each item on its own line; i.e. arranged vertically down the left side of the plot.
    Can this be done?

    Thanks,
    bd
    Last edited by bday1223; 27th September 2011 at 00:03.

  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: QwtLegend orientation on QwtPlot

    Qt Code:
    1. QwtDynGridLayout *layout = qobject_cast<QwtDynGridLayout *>( legend->contentsWidget()->layout() );
    2. if ( layout )
    3. layout->setMaxCols( 1 );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. The following user says thank you to Uwe for this useful post:

    bday1223 (27th September 2011)

Similar Threads

  1. QwtPolarMarker and QwtLegend
    By lokida in forum Qwt
    Replies: 4
    Last Post: 29th March 2011, 10:00
  2. QwtLegend size
    By baray98 in forum Qwt
    Replies: 3
    Last Post: 11th May 2010, 10:55
  3. QwtLegend size
    By baray98 in forum Qwt
    Replies: 0
    Last Post: 10th May 2010, 06:26
  4. Set Title for QWTLegend...
    By umulingu in forum Qwt
    Replies: 3
    Last Post: 23rd March 2010, 10:28
  5. Replies: 1
    Last Post: 9th February 2008, 13:46

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.