<?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[connect button to stackWidget and radioButton to comboBox]]></title><description><![CDATA[<p dir="auto">I want to connect pushButton to stackWidget index I used</p>
<pre><code>connect(ui-&gt;user, SIGNAL(clicked(bool)), ui-&gt;stackedWidget,SLOT(setCurrentIndex(int)));
</code></pre>
<p dir="auto">It is not complete and it does not work</p>
<p dir="auto">And to connect radioButton to the comboBox (if radioButton was hit, comboBox would be enabled) I used</p>
<pre><code>connect(ui-&gt;radioButton_co,SIGNAL(clicked()),ui-&gt;comboBox_co,SLOT(setEnabled(bool)));
</code></pre>
<p dir="auto">It also not complete and it does not work<br />
How should I do this without defining any function?</p>
]]></description><link>https://forum.qt.io/topic/90611/connect-button-to-stackwidget-and-radiobutton-to-combobox</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 09:32:25 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/90611.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 11 May 2018 06:57:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 09:40:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> said in <a href="/post/457563">connect button to stackWidget and radioButton to comboBox</a>:</p>
<blockquote>
<p dir="auto">So you just need button to go exact page. and not navigate back and forth.</p>
</blockquote>
<p dir="auto">at this time ,yes</p>
]]></description><link>https://forum.qt.io/post/457566</link><guid isPermaLink="true">https://forum.qt.io/post/457566</guid><dc:creator><![CDATA[isan]]></dc:creator><pubDate>Fri, 11 May 2018 09:40:35 GMT</pubDate></item><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 09:35:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/isan">@<bdi>isan</bdi></a><br />
Ok super.<br />
So you just need button to go exact page. and not navigate back and forth.</p>
]]></description><link>https://forum.qt.io/post/457563</link><guid isPermaLink="true">https://forum.qt.io/post/457563</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 11 May 2018 09:35:18 GMT</pubDate></item><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 09:35:08 GMT]]></title><description><![CDATA[<pre><code>connect(ui-&gt;checkBox_co,SIGNAL(clicked(bool)),ui-&gt;comboBox_co,SLOT(setEnabled(bool)));
</code></pre>
<p dir="auto">And I use this for change page</p>
<pre><code>connect(ui-&gt;user, &amp;QAbstractButton::clicked, [=](bool b){ui-&gt;stackedWidget-&gt;setCurrentIndex(5);});
</code></pre>
<p dir="auto">it work thanks to u</p>
]]></description><link>https://forum.qt.io/post/457558</link><guid isPermaLink="true">https://forum.qt.io/post/457558</guid><dc:creator><![CDATA[isan]]></dc:creator><pubDate>Fri, 11 May 2018 09:35:08 GMT</pubDate></item><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 09:14:01 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
But dont u need to slots like<br />
nextPage and prevPage ?<br />
to go back and forth. You can use lambdas for compact design.</p>
<p dir="auto">you forgot the parameter type<br />
connect(ui-&gt;checkBox_co,SIGNAL(clicked(<strong>bool</strong>)),ui-&gt;comboBox_co,SLOT(setEnabled(bool)));<br />
also connects return true/false so u can spot when you have made error.</p>
]]></description><link>https://forum.qt.io/post/457552</link><guid isPermaLink="true">https://forum.qt.io/post/457552</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 11 May 2018 09:14:01 GMT</pubDate></item><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 09:07:52 GMT]]></title><description><![CDATA[<p dir="auto">I did this to change the page</p>
<pre><code>void Healthy::on_user_clicked()
{
    ui-&gt;stackedWidget-&gt;setCurrentIndex(5);
}
</code></pre>
<p dir="auto">But I want to use a connection to do this<br />
comboBox is disabled for the first time</p>
<pre><code>ui-&gt;comboBox_co-&gt;setDisabled(1);
</code></pre>
<p dir="auto">I used QCheckBox, but when checking QCheckBox ,the comboBox is not enabled</p>
<pre><code>connect(ui-&gt;checkBox_co,SIGNAL(clicked()),ui-&gt;comboBox_co,SLOT(setEnabled(bool)));
</code></pre>
<p dir="auto">when I run the program I get this</p>
<pre><code>QObject::connect: Incompatible sender/receiver arguments
        QCheckBox::clicked() --&gt; QComboBox::setEnabled(bool)
</code></pre>
]]></description><link>https://forum.qt.io/post/457549</link><guid isPermaLink="true">https://forum.qt.io/post/457549</guid><dc:creator><![CDATA[isan]]></dc:creator><pubDate>Fri, 11 May 2018 09:07:52 GMT</pubDate></item><item><title><![CDATA[Reply to connect button to stackWidget and radioButton to comboBox on Fri, 11 May 2018 08:23:21 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
connect(ui-&gt;user, SIGNAL(clicked(bool)), ui-&gt;stackedWidget,SLOT(setCurrentIndex(int)));</p>
<p dir="auto">Can never work as clicked can maximum send a bool and<br />
setCurrentIndex expects and int that tells what index to go to.</p>
<p dir="auto"><strong>What do u try to make it do with one button ?</strong></p>
<p dir="auto">for combobox<br />
connect(ui-&gt;radioButton_co,SIGNAL(clicked(<strong>bool</strong>)),ui-&gt;comboBox_co,SLOT(setEnabled(bool)));<br />
should work.<br />
But not sure it works as you want as radio buttons normally comes in a group.<br />
If you just have 1 radiobutton, its not possible to unselect it again.</p>
<p dir="auto">If just to enable combo, then QCheckbox might be better.</p>
]]></description><link>https://forum.qt.io/post/457529</link><guid isPermaLink="true">https://forum.qt.io/post/457529</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Fri, 11 May 2018 08:23:21 GMT</pubDate></item></channel></rss>