<?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[QFormLayout does not expand widget full height to maximum widget height]]></title><description><![CDATA[<p dir="auto">I have an issue with getting a QTreewidget full height inside a QFormLayout. I'm on Windows 10 and use QT 5.7</p>
<p dir="auto">Things I tried:</p>
<ul>
<li>all possible Vertical policy's without success.</li>
<li>Change the FieldGrowthPolicy of the layout to AllNonFixedFieldsGrow</li>
<li>Use another widget, all fail to make this work</li>
</ul>
<p dir="auto">That's all the options I found to possibly make this work.</p>
<p dir="auto">Here's what I try to achieve:<br />
<a href="https://postimg.org/image/shtvcby0j/" target="_blank" rel="noopener noreferrer nofollow ugc"><img src="https://s29.postimg.org/hi8o0q7lj/qt_Qform_Layout_Issue.png" alt="qtQformLayoutIssue.png" class=" img-fluid img-markdown" /></a></p>
<p dir="auto">Here's my ui file:</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ui version="4.0"&gt;
 &lt;class&gt;Dialog&lt;/class&gt;
 &lt;widget class="QDialog" name="Dialog"&gt;
  &lt;property name="geometry"&gt;
   &lt;rect&gt;
    &lt;x&gt;0&lt;/x&gt;
    &lt;y&gt;0&lt;/y&gt;
    &lt;width&gt;760&lt;/width&gt;
    &lt;height&gt;747&lt;/height&gt;
   &lt;/rect&gt;
  &lt;/property&gt;
  &lt;property name="windowTitle"&gt;
   &lt;string&gt;Dialog&lt;/string&gt;
  &lt;/property&gt;
  &lt;layout class="QFormLayout" name="formLayout"&gt;
   &lt;item row="0" column="0"&gt;
    &lt;widget class="QLabel" name="label"&gt;
     &lt;property name="text"&gt;
      &lt;string&gt;Please grow the treeview:&lt;/string&gt;
     &lt;/property&gt;
    &lt;/widget&gt;
   &lt;/item&gt;
   &lt;item row="0" column="1"&gt;
    &lt;widget class="QTreeWidget" name="treeWidget"&gt;
     &lt;property name="sizePolicy"&gt;
      &lt;sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"&gt;
       &lt;horstretch&gt;0&lt;/horstretch&gt;
       &lt;verstretch&gt;0&lt;/verstretch&gt;
      &lt;/sizepolicy&gt;
     &lt;/property&gt;
     &lt;column&gt;
      &lt;property name="text"&gt;
       &lt;string notr="true"&gt;1&lt;/string&gt;
      &lt;/property&gt;
     &lt;/column&gt;
    &lt;/widget&gt;
   &lt;/item&gt;
  &lt;/layout&gt;
 &lt;/widget&gt;
 &lt;resources/&gt;
 &lt;connections/&gt;
&lt;/ui&gt;
</code></pre>
]]></description><link>https://forum.qt.io/topic/75245/qformlayout-does-not-expand-widget-full-height-to-maximum-widget-height</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 21:01:12 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/75245.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jan 2017 09:02:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QFormLayout does not expand widget full height to maximum widget height on Sun, 23 Dec 2018 20:23:31 GMT]]></title><description><![CDATA[<p dir="auto">You should set the object in the last row of formlayout (see QTreewidget), its vertical expanding factor should not be 0.</p>
]]></description><link>https://forum.qt.io/post/501127</link><guid isPermaLink="true">https://forum.qt.io/post/501127</guid><dc:creator><![CDATA[adcpk]]></dc:creator><pubDate>Sun, 23 Dec 2018 20:23:31 GMT</pubDate></item><item><title><![CDATA[Reply to QFormLayout does not expand widget full height to maximum widget height on Wed, 18 Jan 2017 10:00:44 GMT]]></title><description><![CDATA[<p dir="auto">Just click on the label and set the alignment property</p>
]]></description><link>https://forum.qt.io/post/370164</link><guid isPermaLink="true">https://forum.qt.io/post/370164</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Wed, 18 Jan 2017 10:00:44 GMT</pubDate></item><item><title><![CDATA[Reply to QFormLayout does not expand widget full height to maximum widget height on Wed, 18 Jan 2017 09:58:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> Okay, that works better, thanks.<br />
However, now the labels are center aligned vertically and the only way to change this seems to be in the AddWidget function.<br />
Is there a way to do this in Qt Designer? Can't seem to select a QGridLayout's cell to set properties of that cell.</p>
]]></description><link>https://forum.qt.io/post/370163</link><guid isPermaLink="true">https://forum.qt.io/post/370163</guid><dc:creator><![CDATA[StormeNet]]></dc:creator><pubDate>Wed, 18 Jan 2017 09:58:03 GMT</pubDate></item><item><title><![CDATA[Reply to QFormLayout does not expand widget full height to maximum widget height on Wed, 18 Jan 2017 09:18:32 GMT]]></title><description><![CDATA[<p dir="auto">I think QFormLayout inserts a spacer at the bottom by default. Convert it to a QGridLayout to have the desired result</p>
]]></description><link>https://forum.qt.io/post/370141</link><guid isPermaLink="true">https://forum.qt.io/post/370141</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Wed, 18 Jan 2017 09:18:32 GMT</pubDate></item></channel></rss>