<?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[Merge item in QGridLayout]]></title><description><![CDATA[<p dir="auto">Recently I'm working with QGridLayout. I want when I select 2 or 4 items in GridLayout, those 4 items will be merged together into 1 large item.  Take a look at the photo below, these are images from another application, I want to get the same result:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/2a1153be-b6ef-4e3f-8517-7082c6674538.png" alt="27b82b87-8bb7-4b89-82ea-0b59520cf8b4-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">After i press Joint button:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/111f7d97-38ad-4907-bcbf-40f1a305420c.png" alt="a7be902e-b7ca-49c4-8e7b-6e92cca2aee5-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Then I got grid like this:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/7ff2ea40-bcfd-4f34-888e-7019788765c8.png" alt="f1cb21d7-04fe-4325-85a6-ed8137a3e04d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">I can get the row-col of the selected item, but I don't know how to merge the selected items into one large item and redraw the grid. Help me please</p>
]]></description><link>https://forum.qt.io/topic/152103/merge-item-in-qgridlayout</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 18:49:29 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/152103.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Nov 2023 08:54:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Merge item in QGridLayout on Wed, 15 Nov 2023 09:17:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hai-anh-luu">@<bdi>Hai-Anh-Luu</bdi></a><br />
"Merging" must be achieved by <em>spanning</em> rows and/or columns.<br />
<a href="https://doc.qt.io/qt-6/qgridlayout.html#addWidget-2" target="_blank" rel="noopener noreferrer nofollow ugc">void QGridLayout::addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment alignment = Qt::Alignment())</a><br />
and similar allow this when placing an item.  I do not see a method to <em>alter</em> the spanning once an item has been added.</p>
]]></description><link>https://forum.qt.io/post/779807</link><guid isPermaLink="true">https://forum.qt.io/post/779807</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 15 Nov 2023 09:17:54 GMT</pubDate></item></channel></rss>