How to print QTableWidget on printer?

I have big size QTableWidget. I want to print it including headers, but QTableWidget doesn't have print() method. How can I implement it?

Answers


The information you want is provided in the Printing with Qt documentation page. In particular, pay attention to the Painting onto a Page section.


You can create a table with HTML and by using QTextDocument's setHtml() method you can set the tables to document then you can use the print() function of document for a continuous print with page numbers.


Need Your Help

Validating User String User Input

c++ string c-strings

So I've been trying to create this program that will take up to 12 digits from the user using string and string classes. The issue I'm having is:

base div height on dynamic canvas height

dynamic html canvas height listener

I have a canvas element that changes in height after some user interaction.