<?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[Gridlayout resize automatically]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">This maybe a quick question, I created a widget with designer, that widget has a gridlayout which can accept 4 widgets (2x2 matrix). The widgets are inserted dynamically, at the beginning is only 1 then 2,3 and the last is 4. When all of them are in the girdlayout matrix, their size are ok, but when there is only  one it looks big.<br />
Is there a way to:</p>
<ol>
<li>Keep their size the same all the time in the gridlayout.</li>
<li>when the first is added, I would to be displayed it a the center of the gridlayout.</li>
</ol>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/118893/gridlayout-resize-automatically</link><generator>RSS for Node</generator><lastBuildDate>Tue, 18 Aug 2026 13:43:21 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/118893.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Sep 2020 16:35:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Gridlayout resize automatically on Thu, 10 Sep 2020 18:10:26 GMT]]></title><description><![CDATA[<p dir="auto">If your add these widgets by</p>
<pre><code>layout-&gt;addWidget(widget, row, column, Qt::AlignCenter);
</code></pre>
<p dir="auto">Then Qt will try to keep their size as their <code>sizeHint()</code> and make them at the center of their cells.</p>
]]></description><link>https://forum.qt.io/post/616697</link><guid isPermaLink="true">https://forum.qt.io/post/616697</guid><dc:creator><![CDATA[Bonnie]]></dc:creator><pubDate>Thu, 10 Sep 2020 18:10:26 GMT</pubDate></item></channel></rss>