Results 1 to 1 of 1

Thread: QPrinter for QTextEdit

  1. #1
    Join Date
    Jun 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question QPrinter for QTextEdit

    Hello

    I use QPrinter to print a table which I create using HTML QTextEdit.

    I will appreciate if somebody can give me a hint of why when printing the table I only get the first page with the first columns and stops. I dont get the rest of the pages with the rest of the table. What should I set so I can get all?

    * Part of my code:

    Qt Code:
    1. QTextEdit text(table) // I checked "table" and it is complete.
    2. // If I send it to the clipboard and paste it in excel it looks fine.
    3.  
    4. QPrinter printer(QPrinter::HighResolution);
    5. printer.setFullPage(true);
    6. QPrintDialog printDialog(&printer);
    7. printDialog.setEnabledOptions(QAbstractPrintDialog::PrintPageRange);
    8. printDialog.setPrintRange(QAbstractPrintDialog::AllPages);
    9. if (text.textCursor().hasSelection()){
    10. printDialog.addEnabledOption(QAbstractPrintDialog::PrintSelection);
    11. }
    12. printDialog.setWindowTitle(tr("Printer"));
    13.  
    14. if (printDialog.exec() == QDialog::Accepted) {
    15. text.print(&printer);
    16. }
    To copy to clipboard, switch view to plain text mode 


    Thanks in advance
    Last edited by wysota; 17th July 2008 at 17:38. Reason: missing [code] tags

Similar Threads

  1. QPrinter on QGraphicsScene Border Problem
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2007, 15:49
  2. QPrinter problems
    By Teuniz in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2007, 08:51
  3. How can I put text on each page using QPrinter
    By davit in forum Qt Programming
    Replies: 2
    Last Post: 15th April 2007, 12:23
  4. How to use QPrinter without QPrintDialog?
    By pascal456 in forum Qt Programming
    Replies: 2
    Last Post: 15th November 2006, 19:57
  5. QPrinter on Solaris
    By ToddAtWSU in forum Qt Programming
    Replies: 4
    Last Post: 24th October 2006, 20:29

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.