Printing the contents of a QTableWidget
I need to print the contents of a QTableWidget, keeping a table-like structure.
The easiest way I found was to generate an HTML code from the table data and then pass it to a QWebView widget.
The problem is that I'm using Qt 4.7.3, which has a bug in Windows that causes the QWebView's "print" slot to print only blank pages. I can't update the SDK because it's being widely used in our projects.
After googling a lot, I've found a workaround: use a QTextEdit or other similar widget and then call its "print" slot. But that don't quite suit my needs because the HTML subset is too restricted. I could not even apply a border to the table, let alone set more complex attributes.
I've then tried to subclass QPainter and add the patch lines manually, but I've got into a lot of trouble for trying to access private members.
What else could I try to solve my problem?
I really appreciate any advice on this.
Did you try some Report engines?