Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
4.8.2, 4.8.4, 4.8.5, 4.8.7, 4.8.x
-
None
-
qt-opensource-windows-x86-mingw482-4.8.7 on Windows 7 64 Bit with Qt Creator
Description
Since my update from Qt 4.7.4 to Qt 4.8.7 it isn't possible for me to print a simple HTML table without cutting off the right side. Here is the code that shows a HTML table in the QPrintPreviewDialog:
QApplication a(argc, argv); QWebView *webView = new QWebView(); webView->load(QUrl("table.html")); QPrinter *printer = new QPrinter(); printer->setPaperSize(QPrinter::A4); QPrintPreviewDialog *printPreview = new QPrintPreviewDialog(printer); QObject::connect(printPreview, SIGNAL(paintRequested(QPrinter*)), webView, SLOT(print(QPrinter*))); a.processEvents(); printPreview->show(); return a.exec();
I attached the HTML table to reproduce this problem and an screenshot of the issue. I think this problem occurs since QtWebkit 2.x. Is there a workaround?
Edit: This problem is not only related to HTML tables. If you use a <p>-tag with a long string, then it will be also truncated. And the bug occurs on every page, not only on the first one. I'm writing this, because I saw a similar bug report, but there was only the first page affected (https://bugreports.qt.io/browse/QTBUG-30621).
Edit2: So far I found the bug in the following Qt versions: 4.8.2, 4.8.4, 4.8.5, 4.8.7