<?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[Update QStackedWidget]]></title><description><![CDATA[<p dir="auto">I have a QStackedWidget with 4 pages and I'm using a QComboBox to switch page. None of the pages have more than 3 child widgets. I set up this widget in designer and add child widgets in my constructor.</p>
<p dir="auto">Sometimes, when I switch page the stacked widget doesn't redraw. Specifically,</p>
<ol>
<li>I select the page using the combo.</li>
<li>The combo does not change text, the page does not change.</li>
<li>If you move the mouse over the combo/stack, the widgets update to the correct state.</li>
</ol>
<p dir="auto">I set up an intermediate slot with an update(), but it doen't make any difference:</p>
<p dir="auto">@<br />
...<br />
connect(pageChooseCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setPage(int)));<br />
...</p>
<p dir="auto">void ThisClass::setPage(int page)<br />
{<br />
stack-&gt;setCurrentIndex(page);<br />
stack-&gt;update();<br />
}<br />
@</p>
<p dir="auto">Does anyone have any suggestions about how to update the widgets ?</p>
<p dir="auto">Platform: Qt 5.1.0 on Mac 10.8.</p>
]]></description><link>https://forum.qt.io/topic/29630/update-qstackedwidget</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 15:55:14 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/29630.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Jul 2013 12:22:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Update QStackedWidget on Fri, 19 Jul 2013 14:40:36 GMT]]></title><description><![CDATA[<p dir="auto">I added a QLabel to my layout and then changed the setPage slot as follows:</p>
<p dir="auto">@<br />
void ThisClass::setPage(int page)<br />
{<br />
/*<br />
stack-&gt;setCurrentIndex(page);<br />
stack-&gt;update();<br />
*/</p>
<p dir="auto">debugLabel-&gt;setText(QString::number(page));<br />
}<br />
@</p>
<p dir="auto">I observed the same problem.</p>
<p dir="auto">The slot is the only signal connection to/from the combo. So I guess QComboBox has a problem.</p>
]]></description><link>https://forum.qt.io/post/187165</link><guid isPermaLink="true">https://forum.qt.io/post/187165</guid><dc:creator><![CDATA[kegon]]></dc:creator><pubDate>Fri, 19 Jul 2013 14:40:36 GMT</pubDate></item><item><title><![CDATA[Reply to Update QStackedWidget on Fri, 19 Jul 2013 14:07:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi, seems the problem is</p>
<p dir="auto">bq.  select the page using the combo. The combo does not change text</p>
<p dir="auto">Which means QCombo doesn't work correctly.</p>
<p dir="auto">Can you reproduce this problem without QStackedWidget?</p>
]]></description><link>https://forum.qt.io/post/187160</link><guid isPermaLink="true">https://forum.qt.io/post/187160</guid><dc:creator><![CDATA[dbzhang800]]></dc:creator><pubDate>Fri, 19 Jul 2013 14:07:40 GMT</pubDate></item></channel></rss>