Results 1 to 2 of 2

Thread: Printing report with more than one plot and additional text

  1. #1
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Printing report with more than one plot and additional text

    Hello

    I would like to print the content of several plots and some text in addition to the same document. In the bode plot example I tried:
    Qt Code:
    1. for (int page = 1; page < 3; ++page) {
    2. d_plot->print(printer, filter);
    3. if (page < 2) printer.newPage();
    4. }
    To copy to clipboard, switch view to plain text mode 
    I expected two pages containing the same plot but got only one page.

    What's wrong? And how I could print some text in between?

    Thank you for all comments.

    Best regards
    Stefan

  2. #2
    Join Date
    Jan 2009
    Posts
    17
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Printing report with more than one plot and additional text

    One mistake has been found and a possible solution is...
    Qt Code:
    1. QPainter painter;
    2. painter.begin(&printer);
    3. for (int page = 1; page < 3; ++page) {
    4. d_plot->print(&painter, printer.pageRect(), filter);
    5. if (page < 2) printer.newPage();
    6. }
    7. painter.end();
    To copy to clipboard, switch view to plain text mode 

    Stefan

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.