Results 1 to 8 of 8

Thread: Embedding Qwt plot High Resolution

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Embedding Qwt plot High Resolution

    I found a solution and it works good.
    Qt Code:
    1. QPrinter printer(QPrinter::HighResolution);
    2. ...
    3. int pw = printer.pageRect().width();
    4. int ph =printer.pageRect().height();
    5.  
    6. p.begin(&printer);
    7.  
    8. p.save();
    9. m_document->adjustSize();
    10. QTransform tra;
    11. tra.scale(11,11);
    12. p.setTransform(tra);
    13.  
    14. m_document->drawContents(&p,printer.paperRect());
    15.  
    16.  
    17. p.restore();
    18. QRect rec(-10,0,pw-10,0.4*ph);
    19. p.translate(0,0.65*ph);
    20. solarDiagram->print(&p,rec,filter);
    21. p.end();
    To copy to clipboard, switch view to plain text mode 
    This is good for A4 paper. The plot is rendered as a vector graphic and I like it.
    But I would scale the painter automatically. The value "11" is taken from a trial-and-correct approach.
    Moreover, I noticed that if I translate the painter, Qwtplot does not print the title of the plot anymore. If I do not translate the painter everything is printerd.Why?

  2. #2
    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: Embedding Qwt plot High Resolution

    Probably a bug in Qwt, that doesn't handle the translation. Try to translate the target rectangle instead of the painter.

    Uwe

  3. #3
    Join Date
    May 2008
    Posts
    276
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Embedding Qwt plot High Resolution

    How? May you a bit more detailed....
    What do you mean for target rect?
    G

Similar Threads

  1. Replies: 4
    Last Post: 10th October 2009, 17:59
  2. legend inside qwt plot
    By kaustav98255 in forum Qwt
    Replies: 5
    Last Post: 11th February 2009, 20:39
  3. Detecting changes in the qwt plot axis
    By mrcolin in forum Qwt
    Replies: 2
    Last Post: 27th January 2009, 12:53
  4. export and printing qwt plot
    By giusepped in forum Qwt
    Replies: 6
    Last Post: 17th December 2008, 07:04
  5. Qwt plot problem on compile
    By sincnarf in forum Qwt
    Replies: 2
    Last Post: 14th October 2007, 11:36

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.