[Qt-interest] QWebView.print() > WYSIWYG

Thiago Alencar thiago777 at gmail.com
Fri Nov 6 02:33:19 CET 2009


Whenever I use QWebView.print(), the output is broken into several
pages, as if the page is really tiny (already tried
.setPageSize(QPrinter::A4) - no luck), or as if the page was zoomed in
a way that there are about 6 lines of text per page, depending on the
point of view.

The code I have is the most simple possible, which I found it the documentation:
--------------------------------
QPrinter printer;
QPrintDialog *dlg = new QPrintDialog(&printer, this);
if (dlg->exec() != QDialog::Accepted)
     return;
m_ui->webViewRoute_2->print(&printer);
--------------------------------

It is weird to me that the same HTML is printed fine from any browser,
but not from QWebView.

Is there any way to print the page as you see it in QWebView? Could it
be the CSS code that is causing this?

Thiago F Alencar




More information about the Qt-interest-old mailing list