Results 1 to 4 of 4

Thread: QwtPlotRenderer and ExternalLegend position

Hybrid View

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

    Default Re: QwtPlotRenderer and ExternalLegend position

    QwtPlotRenderer::render() doesn't include an external legend - instead you have to calculate the layout for the legend in your application code ( like you do it with the legend widget ) and call QwtPlotRenderer::renderLegend() manually.

    Uwe

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

    frankiefrank (28th November 2011)

  3. #2
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlotRenderer and ExternalLegend position

    Thanks for your reply. In my case the legend was indeed rendered although it was defined as ExternalLegend, is that a bug or did I misunderstand the expected behavior you describe?

    I understand I can renderLegend separately but maybe I'm missing QPainter experience, could you please direct me to how I can modify my code to render the legend separately in a position of my choosing? (for example (100,100)) ?

    Thanks as always for your attention and reply,
    Frankie

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

    Default Re: QwtPlotRenderer and ExternalLegend position

    Come on:

    Qt Code:
    1. QPainter painter(&img);
    2. renderer.render(plot, &painter, ... );
    3. renderer.renderLegend( plot, &painter, QRectF( 100, 100, ..., ... ) );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    frankiefrank (29th November 2011)

Similar Threads

  1. Get GPS Position with QML
    By jgaleanog in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 4th August 2011, 11:41
  2. Problems with QwtPlotRenderer from Qwt 6
    By mariposa in forum Qwt
    Replies: 24
    Last Post: 6th October 2010, 13:08
  3. How to get the mouse's position
    By sophister in forum Qt Programming
    Replies: 2
    Last Post: 30th April 2009, 06:07
  4. How to get mouse's position?
    By coralbird in forum Newbie
    Replies: 4
    Last Post: 23rd July 2006, 03:52
  5. set Position
    By mickey in forum Newbie
    Replies: 3
    Last Post: 17th June 2006, 21:30

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
  •  
Qt is a trademark of The Qt Company.