How to change cellPadding of a single merged QTextTableCell?
-
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);