<?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[main widget emit signal once, but slot call multiple time]]></title><description><![CDATA[<p dir="auto">my design has main widget and a sub widget.  I use qt push button to open the subwidget.  but when i close subwidget (x sign) and use the button to open i again,  my signal emit once buy my slot function run twice.  I close subwidget, and open again via qt push button.  now my signal emit once, but my slot function run three time.  any ideas</p>
<p dir="auto">void Main_Widget::launch_sub_widget_button_pushed(){<br />
subwidget_pt = new sub_Widget();<br />
subwidget_pt-&gt;show();</p>
<p dir="auto">connect(this,               SIGNAL(mysig() ),<br />
subwidget_pt, SLOT(myslot() ) );<br />
}</p>
<p dir="auto">signal is emit from another function</p>
<p dir="auto">void Main_Widget::load_data_button_pushed(){<br />
emit(mysig(void));<br />
}</p>
<p dir="auto">i try subwidget_pt-&gt;close()  but it close all my widget including the main one.</p>
]]></description><link>https://forum.qt.io/topic/92692/main-widget-emit-signal-once-but-slot-call-multiple-time</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 16:29:22 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/92692.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Jul 2018 17:33:32 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to main widget emit signal once, but slot call multiple time on Mon, 16 Jul 2018 19:50:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/s002wjh">@<bdi>s002wjh</bdi></a> if your issue is solved, please don't forget to mark you post as such. Thanks.</p>
]]></description><link>https://forum.qt.io/post/469845</link><guid isPermaLink="true">https://forum.qt.io/post/469845</guid><dc:creator><![CDATA[Pablo J. Rogina]]></dc:creator><pubDate>Mon, 16 Jul 2018 19:50:10 GMT</pubDate></item><item><title><![CDATA[Reply to main widget emit signal once, but slot call multiple time on Mon, 16 Jul 2018 18:54:19 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/aha_1980">@<bdi>aha_1980</bdi></a></p>
<p dir="auto">thanks, i saw it will disconnect automatically when i close the sub-widget, guess not.  I didn't properly run the destructor, now its working after i run the destructor.</p>
]]></description><link>https://forum.qt.io/post/469840</link><guid isPermaLink="true">https://forum.qt.io/post/469840</guid><dc:creator><![CDATA[s002wjh]]></dc:creator><pubDate>Mon, 16 Jul 2018 18:54:19 GMT</pubDate></item><item><title><![CDATA[Reply to main widget emit signal once, but slot call multiple time on Mon, 16 Jul 2018 17:43:09 GMT]]></title><description><![CDATA[<p dir="auto">hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/s002wjh">@<bdi>s002wjh</bdi></a>,</p>
<p dir="auto">you run the connect statement multiple times, therefore the slot is executed multiple times.</p>
<p dir="auto">Solution: only connect once, then emit as often as you like.</p>
<p dir="auto">regards</p>
]]></description><link>https://forum.qt.io/post/469830</link><guid isPermaLink="true">https://forum.qt.io/post/469830</guid><dc:creator><![CDATA[aha_1980]]></dc:creator><pubDate>Mon, 16 Jul 2018 17:43:09 GMT</pubDate></item></channel></rss>