Results 1 to 4 of 4

Thread: printing problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default printing problem

    Hi!
    Tell me please is there any another way to print rich text? -
    In the richtext example there is :
    Qt Code:
    1. void MainWindow::printFile()
    2. {
    3. QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget());
    4. QTextDocument *document = editor->document();
    5. QPrinter printer;
    6. printer.setOrientation(QPrinter::Landscape);
    7. printer.setFullPage(false);
    8. printer.setPageSize ( QPrinter::A4 );
    9. QPrintDialog *dialog = new QPrintDialog(&printer, this);
    10. dialog->setWindowTitle(tr("Print Document"));
    11. if (dialog->exec() != QDialog::Accepted)
    12. return;
    13. reporter->setWordWrapMode ( QTextOption::WrapAnywhere );
    14. document->print(&printer);
    15. }
    To copy to clipboard, switch view to plain text mode 
    but QTextEdit lost some options - such as editor->setWordWrapMode ( QTextOption::WrapAnywhere ); during printing.

    What to do ?

    Thanks!
    --
    Igor
    Last edited by wysota; 7th November 2006 at 15:11. Reason: missing [code] tags

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Replies: 0
    Last Post: 28th June 2006, 20:49
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.