<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to change cellPadding of a single merged QTextTableCell?]]></title><description><![CDATA[<p dir="auto">Solution: turns out if you override the cells charFormat or blockFormat it will use the global cellPadding!<br />
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.</p>
<p dir="auto">I've set a global cellPadding via QTextTableFormat::setCellPadding,<br />
but I want to change that cellPadding for a specific TextTableCell as well.<br />
I tried this, but it won't overwrite the global paddings for the cell.<br />
I should mention the desired cell is a merge of two different cells.<br />
The method below will work for cells that are not merged!<br />
Ive set the format on both cells before and after merging, but the format won't apply.</p>
<pre><code>QTextTableCellFormat cellFormat = table-&gt;cellAt(0,2).format().toTableCellFormat();
cellFormat.setLeftPadding(0);
cellFormat.setRightPadding(0);
table-&gt;cellAt(0,2).setFormat(cellFormat);
table-&gt;cellAt(1,2).setFormat(cellFormat);
</code></pre>
]]></description><link>https://forum.qt.io/topic/138585/how-to-change-cellpadding-of-a-single-merged-qtexttablecell</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 13:05:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/138585.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 14 Aug 2022 12:33:06 GMT</pubDate><ttl>60</ttl></channel></rss>