<?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 get GridLayout height]]></title><description><![CDATA[<p dir="auto">I have a GridLayout holding some items in 2 columns and rows as per the requirement.</p>
<pre><code>GridLayout {
      columns: 2
      rowSpacing: 16
      columnSpacing: 16       
      anchors.margins: 16    
      Repeater {
            model: _myModel
            Loader {
                    sourceComponent: _type === "tall" ? _tallComponent : _shortComponent
            }
     }
}
Component {
 id: _tallComponent
 Rectangle {
     width: 500
     height: 200
     color: "red"
 }
}

Component {
 id: _shortComponent
 Rectangle {
     width: 500
     height: 100
     color: "blue"
 }
}
</code></pre>
<p dir="auto">I want to put the above in a ScrollView for which I need to set the content height. Is there any way to the height of the GridLayout above?</p>
]]></description><link>https://forum.qt.io/topic/118993/how-to-get-gridlayout-height</link><generator>RSS for Node</generator><lastBuildDate>Fri, 07 Aug 2026 10:39:21 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/118993.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Sep 2020 07:37:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to get GridLayout height on Tue, 15 Sep 2020 12:42:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bikashrdas">@<bdi>BikashRDas</bdi></a><br />
GridLayout is an Item, it has a <a href="https://doc.qt.io/qt-5/qml-qtquick-item.html#height-prop" target="_blank" rel="noopener noreferrer nofollow ugc">"height" property</a></p>
]]></description><link>https://forum.qt.io/post/617190</link><guid isPermaLink="true">https://forum.qt.io/post/617190</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Tue, 15 Sep 2020 12:42:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to get GridLayout height on Wed, 16 Sep 2020 03:36:35 GMT]]></title><description><![CDATA[<pre><code>  ScrollView  {
                id: scrollV
                clip: true
                anchors.fill:parent
                contentHeight: grid.height                
                contentWidth: grid.width
              
                GridLayout {
                    id:grid
                    width: scrollV.width
                    height: children.length*150
                    spacing: 10
    }
</code></pre>
<p dir="auto">Refer this code, I hope it may help you .</p>
]]></description><link>https://forum.qt.io/post/617295</link><guid isPermaLink="true">https://forum.qt.io/post/617295</guid><dc:creator><![CDATA[shashikumar]]></dc:creator><pubDate>Wed, 16 Sep 2020 03:36:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to get GridLayout height on Tue, 15 Sep 2020 12:42:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/bikashrdas">@<bdi>BikashRDas</bdi></a><br />
GridLayout is an Item, it has a <a href="https://doc.qt.io/qt-5/qml-qtquick-item.html#height-prop" target="_blank" rel="noopener noreferrer nofollow ugc">"height" property</a></p>
]]></description><link>https://forum.qt.io/post/617190</link><guid isPermaLink="true">https://forum.qt.io/post/617190</guid><dc:creator><![CDATA[ODБOï]]></dc:creator><pubDate>Tue, 15 Sep 2020 12:42:46 GMT</pubDate></item></channel></rss>