Results 1 to 5 of 5

Thread: multiple plots in QVBoxLayout: different length of legends, but same canvas width?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multiple plots in QVBoxLayout: different length of legends, but same canvas width

    thanks, i will try that.

    but if it really sets the geometry of the whole plot widget, it won't work i guess, because the legend on the right (symbol/text) is actually part of the plot widget.
    that's why i probably need to set a fixed size for the "canvas"/"painting area"/"left part"/hope you know what i mean ...

    but i will try setGeometry first before i complain too much.

    // EDIT: as i expected, setGeometry unfortunately doesn't work, because the width/height of all the plots is the same.
    anyway, thanks for the answer, at least one person who read all the stuff!

    // EDIT2: btw: setting the minimum- and maximum-width for the legend item (legend()) and/or canvas (canvas()) doesn't work aswell.
    the legend/canvas is resized, but the "actual painting area" (like when you resize the whole plot widget, the whole painting are + scale is scaled correctly) isn't resized.

    sincerely,
    julian
    Last edited by -=Freaky=-; 15th October 2008 at 11:30.

  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: multiple plots in QVBoxLayout: different length of legends, but same canvas width

    Insert the legend as QwtPlot::ExternalLegend and organize your plots and legends in a QGridLayout.
    Note, that external legends are not printed by QwtPlot::print. So if you need printing you have to call QwtPlot::printLegend() manually.

    Uwe

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

    -=Freaky=- (15th October 2008)

  4. #3
    Join Date
    Aug 2008
    Posts
    14
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: multiple plots in QVBoxLayout: different length of legends, but same canvas width

    thanks alot uwe!
    i read that part of the docs so many times but just didn't see its importance ...
    everything works fine now!

    sincerely,
    julian

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.