<?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[Label does not resize with resizeEvent]]></title><description><![CDATA[<pre><code>lbl = new QLabel( ui-&gt;centralWidget);
    lbl-&gt;setStyleSheet("Background-color:pink");
</code></pre>
<p dir="auto">How do i resize this label using resizeEvent . When i put this code in void Mainwindow :: resizeEvent(QreseizeEvent *evt) ; it stays the same. The size does not change.</p>
<p dir="auto">Please give me a proper explanation about resize event.</p>
<p dir="auto">Thank you.</p>
]]></description><link>https://forum.qt.io/topic/70077/label-does-not-resize-with-resizeevent</link><generator>RSS for Node</generator><lastBuildDate>Thu, 15 Oct 2026 04:38:18 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/70077.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Aug 2016 18:46:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Label does not resize with resizeEvent on Wed, 10 Aug 2016 04:17:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ronyns">@<bdi>ronyNS</bdi></a> Why not use a layout for that? I just tried: added a label to main window and set the layout in main window: label is resized even if I maximize window.</p>
]]></description><link>https://forum.qt.io/post/341568</link><guid isPermaLink="true">https://forum.qt.io/post/341568</guid><dc:creator><![CDATA[jsulm]]></dc:creator><pubDate>Wed, 10 Aug 2016 04:17:08 GMT</pubDate></item><item><title><![CDATA[Reply to Label does not resize with resizeEvent on Wed, 10 Aug 2016 03:19:53 GMT]]></title><description><![CDATA[<p dir="auto">It fits the window size , but does not resize when i maximize the window</p>
<p dir="auto">My code</p>
<pre><code>Void MainWindow :: resizeEvent(QResizeEvent *event)
{
lbl = new QLabel (ui-&gt;centralWidget);
Int x = MainWindow::size().height();
Int y = MainWindow::size().width();
lbl-&gt;resize(x,y);

MainWindow::resizeEvent(evt);
}


</code></pre>
]]></description><link>https://forum.qt.io/post/341561</link><guid isPermaLink="true">https://forum.qt.io/post/341561</guid><dc:creator><![CDATA[ronyNS]]></dc:creator><pubDate>Wed, 10 Aug 2016 03:19:53 GMT</pubDate></item><item><title><![CDATA[Reply to Label does not resize with resizeEvent on Tue, 09 Aug 2016 20:22:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ronyns">@<bdi>ronyNS</bdi></a> said:</p>
<blockquote>
<p dir="auto">resizeEvent</p>
</blockquote>
<p dir="auto"><a href="http://doc.qt.io/qt-5/qwidget.html#resizeEvent" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qwidget.html#resizeEvent</a></p>
<p dir="auto">Its called when mainwindow change size.</p>
<p dir="auto">To size a qlabel<br />
you do<br />
lbl-&gt;resize(x,y)<br />
or<br />
lbl-&gt;setGeometry(0,0, event-&gt;size().width(), event-&gt;size().height());<br />
to use the mainwindow values</p>
]]></description><link>https://forum.qt.io/post/341533</link><guid isPermaLink="true">https://forum.qt.io/post/341533</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 09 Aug 2016 20:22:56 GMT</pubDate></item></channel></rss>