<?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[[solved] Problem of uncheck all the Radio buttons within a groupbox]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I have a groupbox with property 'checkable'  equal to true.  It contains 3 RadioButtons.<br />
I need to uncheck all RadioButtons when user unchecked the groupbox.</p>
<p dir="auto">So I used following method.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> MyPropertiesWidget::on_groupBox_toggled(bool checked)<br />
{<br />
if (checked)<br />
{<br />
pp-&gt;setFactor("1");</p>
<pre><code>}
else
{

    foreach(QRadioButton *rb,ui-&gt;groupBox-&gt;findChildren&lt;QRadioButton *&gt;())
    {
        rb-&gt;setChecked(false);

        qDebug() &lt;&lt; rb-&gt;text() &lt;&lt; rb-&gt;isChecked();
    }
    pp-&gt;setFactor("0");
}
</code></pre>
<p dir="auto">}@</p>
<p dir="auto">But after going through the foreach loop it give me following results.</p>
<p dir="auto">"1" true<br />
"2" false<br />
"3" false</p>
<p dir="auto">Moreover, those 3 buttons own or a button group.  It's buttonclicked SIGNAL connect to following SLOT.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/void">@<bdi>void</bdi></a> MyPropertiesWidget::setFactor(QAbstractButton *clicked_button)<br />
{<br />
pp-&gt;setFactor(clicked_button-&gt;text());<br />
}@</p>
<p dir="auto">Can anyone help me?</p>
<p dir="auto">Thanks in advance...</p>
]]></description><link>https://forum.qt.io/topic/37924/solved-problem-of-uncheck-all-the-radio-buttons-within-a-groupbox</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 19:54:54 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/37924.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 17 Feb 2014 11:33:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [solved] Problem of uncheck all the Radio buttons within a groupbox on Tue, 18 Feb 2014 02:56:59 GMT]]></title><description><![CDATA[<p dir="auto">I found answer "here":<a href="http://stackoverflow.com/questions/1731620/is-there-a-way-to-have-all-radion-buttons-be-unchecked" target="_blank" rel="noopener noreferrer nofollow ugc">http://stackoverflow.com/questions/1731620/is-there-a-way-to-have-all-radion-buttons-be-unchecked</a>.</p>
]]></description><link>https://forum.qt.io/post/215260</link><guid isPermaLink="true">https://forum.qt.io/post/215260</guid><dc:creator><![CDATA[Hareen Laks]]></dc:creator><pubDate>Tue, 18 Feb 2014 02:56:59 GMT</pubDate></item></channel></rss>