Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.9.0
-
None
Description
I want to output the full widget to a pdf file, so I use the QWidget::render() method.
Here's my code:
QPdfWriter pw("D://test.pdf");
QPainter pt;
pt.begin(&pw);
ui->tableWidget->render(&pt);
pt.end();
The reason for using QPdfWriter is that I want the pdf to be vectorized,so I did not use QPrinter.
So here's my question:
If the horizontal headerView and the vertical headerView of the QTableWidget is visible,
Then the table will be incomplete in the pdf file, and the format will be confused or missing.
Similarly, the same problem occurs if the table has a cell merge operation.
Here is the correct format:
Below is the exported pdf file: