<?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[QTabWidget not reduced]]></title><description><![CDATA[<p dir="auto">Hi, everyone!<br />
I have a QTabWidget in my project with several tabs.<br />
On the first tab there is only one small widget. On the second tab I've many other widget's and when I picked up this tab all my window grew to a suitable size. After that I picked up the first tab but the size didn't change even I couldn't do it by hand.<br />
(I added a scroll to solve this problem temporarily. Because on the second tab too many widgets that made the app bigger than my display)</p>
<p dir="auto">Now I want to find a way to make this widget resizable!<br />
It would be nice if the widget reduced size to a suitable size.<br />
I tried to use "sizePolicy", but nothing changed</p>
]]></description><link>https://forum.qt.io/topic/47228/qtabwidget-not-reduced</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 17:56:06 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/47228.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Oct 2014 10:48:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QTabWidget not reduced on Mon, 27 Oct 2014 05:06:23 GMT]]></title><description><![CDATA[<p dir="auto">1)This layout have Fixed size. It's one of lists in a TabWidget. When I add here many big widgets it grows. I go to another List and this list has the same size even it's empty, And I can't reduce the size of empty List by hand. I tried to do it in code using setMinimumSize, sizeHint... But the TabWidget has Fixed size.<br />
@layoutATabL-&gt;setSizeConstraint(QLayout::SetFixedSize);@</p>
<p dir="auto">2)Well... Then I added a ScrollArea. But now I have a grey frame around my widgets. scrollAreaWidgetContents makes this Frame, I think so. But How can I make it invisible.<br />
@<br />
listTabA = new QTabWidget(tabA);<br />
listTabA-&gt;setObjectName(QString::fromUtf8("listTabA"));<br />
layoutATab-&gt;addWidget(listTabA,0,0,1,1);<br />
tabAL1 = new QWidget(listTabA);<br />
tabAL1-&gt;setObjectName(QString::fromUtf8("tabAL1"));<br />
listTabA-&gt;addTab(tabAL1,QString::fromUtf16(L"Ком 1"));</p>
<p dir="auto">QGridLayout *gridLayout = new QGridLayout(tabAL1);<br />
gridLayout-&gt;setSpacing(3);<br />
gridLayout-&gt;setContentsMargins(6,6,6,6);<br />
gridLayout-&gt;setObjectName(QString::fromUtf8("gridLayout1"));</p>
<p dir="auto">//-------------------------<br />
QScrollArea *scrollArea = new QScrollArea(mainTab);<br />
scrollArea-&gt;setObjectName(QString::fromUtf8("scrollArea"));<br />
scrollArea-&gt;setWidgetResizable(true);<br />
QWidget *scrollAreaWidgetContents = new QWidget(scrollArea);<br />
scrollAreaWidgetContents-&gt;setObjectName(QString::fromUtf8("scrollAreaWidgetContents"));</p>
<p dir="auto">layoutATabL = new QGridLayout(scrollAreaWidgetContents);<br />
layoutATabL-&gt;setSpacing(3);<br />
layoutATabL-&gt;setContentsMargins(11,11,11,11);<br />
layoutATabL-&gt;setObjectName(QString::fromUtf8("layoutAL1"));<br />
layoutATabL-&gt;setSizeConstraint(QLayout::SetFixedSize);</p>
<p dir="auto">scrollArea-&gt;setWidget(scrollAreaWidgetContents);<br />
//-------------------------<br />
gridLayout-&gt;addWidget(scrollArea);@</p>
]]></description><link>https://forum.qt.io/post/249084</link><guid isPermaLink="true">https://forum.qt.io/post/249084</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 27 Oct 2014 05:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget not reduced on Sun, 26 Oct 2014 16:18:17 GMT]]></title><description><![CDATA[<p dir="auto">even  using e.g. setFixedSize ?</p>
<p dir="auto">Do you mean -&gt; QTabWidget -&gt; QScrollArea -&gt; Your Tab Widget ?</p>
]]></description><link>https://forum.qt.io/post/249021</link><guid isPermaLink="true">https://forum.qt.io/post/249021</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Sun, 26 Oct 2014 16:18:17 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget not reduced on Thu, 23 Oct 2014 11:39:05 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, SGaist<br />
I tried to play with different widget's sizes. But mb I can't fix it because my Layout have SetFixedSize.. (It's needed me for correct displaying)</p>
<p dir="auto">one more question then.. I'm trying to put my Tab's in QScrollArea, but then I have one more Frame around my widgets and grey background. How can I make it invisible. I just want ScrollBar appears when he is needed (without frame).</p>
]]></description><link>https://forum.qt.io/post/248762</link><guid isPermaLink="true">https://forum.qt.io/post/248762</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 23 Oct 2014 11:39:05 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget not reduced on Mon, 20 Oct 2014 23:00:07 GMT]]></title><description><![CDATA[<p dir="auto">Hi and welcome to devnet,</p>
<p dir="auto">setMinimumsize(0, 0) won't do anything special you are just telling your mainTab that it's smallest size is 0, 0. You should rather resize it based on the current widget sizeHint</p>
]]></description><link>https://forum.qt.io/post/248419</link><guid isPermaLink="true">https://forum.qt.io/post/248419</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Mon, 20 Oct 2014 23:00:07 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget not reduced on Mon, 20 Oct 2014 11:27:19 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="Gerolf" date="1413802755"]H and welcome to DevNet.</p>
<p dir="auto">In fact, a widget always grows untill all needed widgets fit. If you have a tab, it might be, that the widgets gets bigger on displaying a tab. It wioll grow to the minimum size of the tab. If you switch away again, the new minimum size stays.</p>
<p dir="auto">So maybe you can play with minimumSize, but that might result in a funny second tab...[/quote]</p>
<p dir="auto">thanks, Gerolf.<br />
I set connection between Tab's SIGNAL  and my slot where I set up minimumSize (0,0) but nothing  changed.<br />
@<br />
QObject::connect(mainTab,SIGNAL(currentChanged(int)),this,SLOT(resizeMainTab()));</p>
<p dir="auto">void MainWindow::resizeMainTab()<br />
{<br />
mainTab-&gt;setMinimumSize(0,0);<br />
mainTab-&gt;update();<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/248320</link><guid isPermaLink="true">https://forum.qt.io/post/248320</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 20 Oct 2014 11:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to QTabWidget not reduced on Mon, 20 Oct 2014 10:59:15 GMT]]></title><description><![CDATA[<p dir="auto">H and welcome to DevNet.</p>
<p dir="auto">In fact, a widget always grows untill all needed widgets fit. If you have a tab, it might be, that the widgets gets bigger on displaying a tab. It wioll grow to the minimum size of the tab. If you switch away again, the new minimum size stays.</p>
<p dir="auto">So maybe you can play with minimumSize, but that might result in a funny second tab...</p>
]]></description><link>https://forum.qt.io/post/248316</link><guid isPermaLink="true">https://forum.qt.io/post/248316</guid><dc:creator><![CDATA[giesbert]]></dc:creator><pubDate>Mon, 20 Oct 2014 10:59:15 GMT</pubDate></item></channel></rss>