<?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[How to reply to an emitter dynamicaly]]></title><description><![CDATA[<p dir="auto">Hello everybody,<br />
I would like to know if inside a slot (the receiver) I can connect a signal to it in order to reply to it and then disconnect the signal after it has been emitted in order to manage an other client?</p>
<p dir="auto">Thank you very much for your shares.</p>
<p dir="auto">Cheers</p>
<p dir="auto">What I have in mind...</p>
<p dir="auto">public slots:<br />
void onReceived()<br />
{<br />
QObject * emitter = ... (I don't know how.... )<br />
connect(this, SIGNAL(sigReply(args...), emitter, SLOT(onReply(args...));<br />
// do something<br />
emit sigReply(things...);<br />
disconnect(this,SIGNAL(sigReply(args...), emitter, SLOT(onReply(args...));<br />
}</p>
]]></description><link>https://forum.qt.io/topic/145953/how-to-reply-to-an-emitter-dynamicaly</link><generator>RSS for Node</generator><lastBuildDate>Fri, 06 Nov 2026 10:28:00 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/145953.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jun 2023 19:30:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to reply to an emitter dynamicaly on Thu, 22 Jun 2023 20:14:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/azerty">@<bdi>Azerty</bdi></a> said in <a href="/post/762374">How to reply to an emitter dynamicaly</a>:</p>
<blockquote>
<p dir="auto">I would like to know if inside a slot (the receiver) I can connect a signal to it in order to reply to it and then disconnect the signal after it has been emitted in order to manage an other client?</p>
</blockquote>
<p dir="auto">This sounds like weird design.<br />
Are you doing some server - client connection?</p>
<p dir="auto">Anyway, there is <code>QObject::sender()</code> which can be used inside slots to get the signal emitting <code>QObject</code></p>
<ul>
<li><a href="https://doc.qt.io//qt-6/qobject.html#sender" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io//qt-6/qobject.html#sender</a></li>
</ul>
]]></description><link>https://forum.qt.io/post/762378</link><guid isPermaLink="true">https://forum.qt.io/post/762378</guid><dc:creator><![CDATA[Pl45m4]]></dc:creator><pubDate>Thu, 22 Jun 2023 20:14:51 GMT</pubDate></item></channel></rss>