View Full Version : QTextDocument Table border

14th June 2013, 15:55

i am using a QTextDocument to print a report.

This report needs to contain a table as shown here below.

I have tried to use border-(right|left), but its being ignored.
Is here an other solution?

Any help is appreciated, thanks.


17th June 2013, 10:20

I found 2 people that had the same problem.

patrik08 (http://www.qtcentre.org/threads/10198-QTextTableCell-border-1pt-bottom-append), He got the answer: "Have you tried applying a text format on the cell?"
QTextFormat has only a property to set the total border, not the indepenend once (left, right, bottom, top)

ChrisW67 (http://www.qtcentre.org/threads/19899-QTextTableCell-Border), He came to the solution: "painting the table using individual lines and bits of text or perhaps merging the text into a page-sized SVG. Hardly nice, but it'll give the ultimate in control"

I was thinking of the solution to subclass QTextFrameFormat and add a property to set the top, right, bottom and left border. but than need i to re implement the QTextDocument print function and check if it is my subclass and that print differently. this solution does not sound right. i think even impossible.

But i don't know how to implement the solution of chris.

Any help is appreciated,

17th June 2013, 16:30
when i use QWebkit