<?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 set cell size of QTableWidget?]]></title><description><![CDATA[<p dir="auto">Solved:</p>
<pre><code>ui-&gt;tableWidget-&gt;horizontalHeader()-&gt;setDefaultSectionSize(60);    // width
ui-&gt;tableWidget-&gt;verticalHeader()-&gt;setDefaultSectionSize(60);      // height
......
ui-&gt;tableWidget-&gt;setCellWidget(r,c,widget);
</code></pre>
]]></description><link>https://forum.qt.io/topic/91658/how-to-set-cell-size-of-qtablewidget</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 15:19:01 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/91658.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 14 Jun 2018 16:15:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to set cell size of QTableWidget? on Wed, 07 Aug 2019 18:51:08 GMT]]></title><description><![CDATA[<p dir="auto">but how can i do this?</p>
]]></description><link>https://forum.qt.io/post/545172</link><guid isPermaLink="true">https://forum.qt.io/post/545172</guid><dc:creator><![CDATA[frnklu20]]></dc:creator><pubDate>Wed, 07 Aug 2019 18:51:08 GMT</pubDate></item><item><title><![CDATA[Reply to How to set cell size of QTableWidget? on Fri, 15 Jun 2018 10:01:41 GMT]]></title><description><![CDATA[<p dir="auto">For the people ending here from google.<br />
The solution that avoids the awful <code>setCellWidget</code>  is using a <code>QStyledItemDelegate</code> subclass that reimplements <code>sizeHint()</code></p>
]]></description><link>https://forum.qt.io/post/463856</link><guid isPermaLink="true">https://forum.qt.io/post/463856</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Fri, 15 Jun 2018 10:01:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to set cell size of QTableWidget? on Thu, 14 Jun 2018 17:22:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sonichy">@<bdi>sonichy</bdi></a><br />
try:</p>
<pre><code>QTabelWIdgetItem* item = new QTableWidgetItem;
   item-&gt;setSizeHint( widget-&gt;sizeHint() );
ui-&gt;tableWidget-&gt;setCellWidget(r,c,item);
ui-&gt;tableWidget-&gt;setCellWidget(r,c,widget);
</code></pre>
]]></description><link>https://forum.qt.io/post/463687</link><guid isPermaLink="true">https://forum.qt.io/post/463687</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 14 Jun 2018 17:22:02 GMT</pubDate></item></channel></rss>