<?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[Do you need to disconnect buttons?]]></title><description><![CDATA[<p dir="auto">Hello</p>
<p dir="auto">I am making an application that steps thought a series of processes. Once complete step one, the user presses the "next" button and it moves to a new looking page. To do this I have once page set up and when the user presses "next" the labels, text images are changed with code to give the page a new look.</p>
<p dir="auto">To do this at the start of each new page function there is a new connect to two buttons, one of the buttons is to carry out the test one the page(normally data extraction from USB) and the other button is the "next" button.</p>
<p dir="auto">at top of void onclick_btn_next7()</p>
<pre><code>//connect button
connect(ui.btn_next, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_btn_next8);
connect(ui.btn_doSomething, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_getTempData);
</code></pre>
<p dir="auto">at top of void onclick_btn_next8()</p>
<pre><code>//connect button
connect(ui.btn_next, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_btn_next9);
connect(ui.btn_doSomething, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_getAccTempData);
</code></pre>
<p dir="auto">at top of void onclick_btn_next9()</p>
<pre><code>//connect button
connect(ui.btn_next, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_btn_next10);
connect(ui.btn_doSomething, &amp;QPushButton::clicked, this, &amp;ManuNonEng::onclick_getAdcTempData);

</code></pre>
<p dir="auto">The problem I am have is the previous pages are still trying to open when further through the steps and the application becomes very slow. I have put qDebug()'s in to for checking and the further through the steps the early pages are trying to open more and more and the button is pressed.</p>
<p dir="auto">Like I said I think it is because the same button is connected so I was wondering if the button is then connected to running multiple functions when it is clicked.</p>
<p dir="auto">Any advice would be excellent!</p>
<p dir="auto">Thanks</p>
]]></description><link>https://forum.qt.io/topic/129687/do-you-need-to-disconnect-buttons</link><generator>RSS for Node</generator><lastBuildDate>Tue, 04 Aug 2026 20:23:37 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/129687.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Aug 2021 10:04:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Do you need to disconnect buttons? on Tue, 24 Aug 2021 18:50:30 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Aren't you re-inventing <a href="https://doc.qt.io/qt-5/qwizard.html" target="_blank" rel="noopener noreferrer nofollow ugc">QWizard</a> ?</p>
]]></description><link>https://forum.qt.io/post/677574</link><guid isPermaLink="true">https://forum.qt.io/post/677574</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 24 Aug 2021 18:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Do you need to disconnect buttons? on Tue, 24 Aug 2021 12:09:29 GMT]]></title><description><![CDATA[<p dir="auto">Yeah, that is accatly what was happening. I was looking to do some sort of disconnect() that worked in the same that that connect() and was just told by someone that I could just do myButton.disconnect(); Working well now :-)</p>
<p dir="auto">Simple problems have simple solutions!</p>
]]></description><link>https://forum.qt.io/post/677460</link><guid isPermaLink="true">https://forum.qt.io/post/677460</guid><dc:creator><![CDATA[aftershocker1]]></dc:creator><pubDate>Tue, 24 Aug 2021 12:09:29 GMT</pubDate></item><item><title><![CDATA[Reply to Do you need to disconnect buttons? on Tue, 24 Aug 2021 11:58:41 GMT]]></title><description><![CDATA[<p dir="auto">I don't follow exactly what you are saying, but you should not be executing <code>connect()</code>s to connect the same signal and slot objects together more than once.  If you do so, Qt will maintain multiple duplicate connections and call the slot many times on the signal.</p>
<p dir="auto">Usually you arrange to only do <code>connect()</code>s once, preferably when the slot object is created.  If that is not convenient,  are you aware that <code>connect()</code> accepts a <a href="https://doc.qt.io/qt-5/qt.html#ConnectionType-enum" target="_blank" rel="noopener noreferrer nofollow ugc">Qt::UniqueConnection</a> parameter, to ignore duplicate connections?</p>
<p dir="auto">You can also forcibly call <code>QObject::disconnect()</code> to explicitly remove signal/slot pairs.  Usually this is not necessary, as Qt does disconnects for you if you delete signal or slot objects.</p>
]]></description><link>https://forum.qt.io/post/677457</link><guid isPermaLink="true">https://forum.qt.io/post/677457</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 24 Aug 2021 11:58:41 GMT</pubDate></item><item><title><![CDATA[Reply to Do you need to disconnect buttons? on Tue, 24 Aug 2021 10:29:09 GMT]]></title><description><![CDATA[<p dir="auto">To further explain what is happening. When I open page 8 it runs the "open page 8" function 2 times.<br />
When I open page 9 it runs the "open page 8" a further 7 times in the background.<br />
When i open page 10 it runs the "open page 8" a further 21 times times in the background.<br />
When i open page 11 it runs the "open page 8" a further 67 times times in the background.</p>
]]></description><link>https://forum.qt.io/post/677442</link><guid isPermaLink="true">https://forum.qt.io/post/677442</guid><dc:creator><![CDATA[aftershocker1]]></dc:creator><pubDate>Tue, 24 Aug 2021 10:29:09 GMT</pubDate></item></channel></rss>