igor_x
7th November 2006, 08:16
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());
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);
}
but QTextEdit lost some options - such as editor->setWordWrapMode ( QTextOption::WrapAnywhere ); during printing.
What to do ?
Thanks!
--
Igor
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());
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);
}
but QTextEdit lost some options - such as editor->setWordWrapMode ( QTextOption::WrapAnywhere ); during printing.
What to do ?
Thanks!
--
Igor