Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to change cellPadding of a single merged QTextTableCell?

How to change cellPadding of a single merged QTextTableCell?

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 327 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qt3.14
    wrote on last edited by qt3.14
    #1

    Solution: turns out if you override the cells charFormat or blockFormat it will use the global cellPadding!
    So all i had to do was to apply the TextTableCellFormat AFTER i had inserted my Text and its colours etc. to the desired cell.

    I've set a global cellPadding via QTextTableFormat::setCellPadding,
    but I want to change that cellPadding for a specific TextTableCell as well.
    I tried this, but it won't overwrite the global paddings for the cell.
    I should mention the desired cell is a merge of two different cells.
    The method below will work for cells that are not merged!
    Ive set the format on both cells before and after merging, but the format won't apply.

    QTextTableCellFormat cellFormat = table->cellAt(0,2).format().toTableCellFormat();
    cellFormat.setLeftPadding(0);
    cellFormat.setRightPadding(0);
    table->cellAt(0,2).setFormat(cellFormat);
    table->cellAt(1,2).setFormat(cellFormat);
    
    1 Reply Last reply
    2

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved