Hi!
Tell me please is there any another way to print rich text? -
In the richtext example there is :
void MainWindow::printFile()
{
QTextEdit *editor
= static_cast<QTextEdit
*>
(letters
->currentWidget
());
printer.
setOrientation(QPrinter::Landscape);
printer.setFullPage(false);
dialog->setWindowTitle(tr("Print Document"));
if (dialog
->exec
() != QDialog::Accepted) return;
reporter
->setWordWrapMode
( QTextOption::WrapAnywhere );
document->print(&printer);
}
void MainWindow::printFile()
{
QTextEdit *editor = static_cast<QTextEdit*>(letters->currentWidget());
QTextDocument *document = editor->document();
QPrinter printer;
printer.setOrientation(QPrinter::Landscape);
printer.setFullPage(false);
printer.setPageSize ( QPrinter::A4 );
QPrintDialog *dialog = new QPrintDialog(&printer, this);
dialog->setWindowTitle(tr("Print Document"));
if (dialog->exec() != QDialog::Accepted)
return;
reporter->setWordWrapMode ( QTextOption::WrapAnywhere );
document->print(&printer);
}
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
Bookmarks