PDA

View Full Version : Inserting two parallel QTextTable inside QTextDocument



SIFE
11th January 2012, 22:48
I am trying to print a report using QTextDocument, one of the challenges I face now is how to insert two parallel QTextTable, one in the right and the other in the left.
See the image in the attachment, 1 and 2 should be QTextTable.

wysota
12th January 2012, 21:08
What have you already tried?

Melkorniano
20th November 2017, 22:11
Did you solve the problem? I need to do something similar.

d_stranz
21st November 2017, 05:17
Since the OP hasn't posted anything here in 4 years, I wouldn't waste too much time waiting for a reply...

Melkorniano
22nd November 2017, 09:49
You're right. I do not want to open a new thread, because my problem is the same.
I need to put tables in a row, until now I have tried unsuccessfully placing frames, but they are always located one on top of the other.
I wonder if it is possible to do it in some way.

d_stranz
22nd November 2017, 19:05
Why not try making a table with as many columns as both tables combined? Put the columns of table 1 into the first "n" columns of the big table, and put the columns of table 2 into the next "m" columns. You could add a padding column in between the two tables with the appropriate width.

Alternatively, since QTextDocument uses Rich Text Format (a subset of HTML), you could just insert HTML directly, as in this post. (http://www.qtforum.org/article/14080/qtextedit-format-text-into-two-columns-qt3.html)

Melkorniano
23rd November 2017, 17:59
Thanks, I'll try it. I'll come back with the results.

Melkorniano
25th November 2017, 10:49
Ok, I figured out. I create a "Main Table" with two columns and one row, resulting in a table with two cells. Then, I put the cursor in each cell and insert the necessaries tables inside the cells.

The result is in the attached image (without formatting).