Results 1 to 8 of 8

Thread: Inserting two parallel QTextTable inside QTextDocument

  1. #1
    Join Date
    Feb 2011
    Posts
    64
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Inserting two parallel QTextTable inside QTextDocument

    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.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    What have you already tried?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Nov 2017
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    Did you solve the problem? I need to do something similar.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    Since the OP hasn't posted anything here in 4 years, I wouldn't waste too much time waiting for a reply...
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Nov 2017
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    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.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    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.
    Last edited by d_stranz; 22nd November 2017 at 20:16.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  7. #7
    Join Date
    Nov 2017
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    Thanks, I'll try it. I'll come back with the results.

  8. #8
    Join Date
    Nov 2017
    Posts
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inserting two parallel QTextTable inside QTextDocument

    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).
    Attached Images Attached Images

  9. The following user says thank you to Melkorniano for this useful post:

    d_stranz (25th November 2017)

Similar Threads

  1. Problem inserting items inside TreeWidget
    By hakermania in forum Newbie
    Replies: 14
    Last Post: 4th May 2011, 19:57
  2. Inserting label inside textEdit widget
    By dshan in forum Qt Programming
    Replies: 1
    Last Post: 11th January 2011, 12:17
  3. Inserting links in QTextDocument
    By deca5423 in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2010, 03:19
  4. Progress Bar set value inside OpenMP parallel for
    By lixo1 in forum Qt Programming
    Replies: 2
    Last Post: 18th February 2010, 20:51
  5. Insert SVG inside QTextDocument
    By giusepped in forum Qt Programming
    Replies: 6
    Last Post: 23rd April 2009, 20:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.