<?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[Can I Intercept client calls to connect a slot to my object&#x27;s signal?]]></title><description><![CDATA[<p dir="auto">I'm trying to figure out how I can intercept client calls to connect()  to a signal exposed by my object.  Emitting my signal  requires some significant CPU work to be done by my object and only wish that to happen while some client has actually connected a slot to it so as to avoid wasting CPU otherwise.</p>
<p dir="auto">Is there a way I can make my object intercept client's connecting to / disconnecting from my signal?</p>
<p dir="auto">I've gone over the documentation and tried to step through the actual connect() code but I don't see a good spot.</p>
<p dir="auto">Thanks,</p>
<p dir="auto">-Joe</p>
]]></description><link>https://forum.qt.io/topic/72037/can-i-intercept-client-calls-to-connect-a-slot-to-my-object-s-signal</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 04:25:09 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/72037.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 06 Oct 2016 12:39:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Can I Intercept client calls to connect a slot to my object&#x27;s signal? on Thu, 06 Oct 2016 18:21:26 GMT]]></title><description><![CDATA[<p dir="auto">Perfect, that is it!    I don't know how I could have missed that.  I thought I'd scanned those docs up and down.</p>
<p dir="auto">Thank you</p>
]]></description><link>https://forum.qt.io/post/352409</link><guid isPermaLink="true">https://forum.qt.io/post/352409</guid><dc:creator><![CDATA[JMO_GS]]></dc:creator><pubDate>Thu, 06 Oct 2016 18:21:26 GMT</pubDate></item><item><title><![CDATA[Reply to Can I Intercept client calls to connect a slot to my object&#x27;s signal? on Thu, 06 Oct 2016 17:11:33 GMT]]></title><description><![CDATA[<p dir="auto">I think <a href="http://doc.qt.io/qt-5/qobject.html#connectNotify" target="_blank" rel="noopener noreferrer nofollow ugc">connectNotify</a> is what you want.</p>
]]></description><link>https://forum.qt.io/post/352397</link><guid isPermaLink="true">https://forum.qt.io/post/352397</guid><dc:creator><![CDATA[mchinand]]></dc:creator><pubDate>Thu, 06 Oct 2016 17:11:33 GMT</pubDate></item><item><title><![CDATA[Reply to Can I Intercept client calls to connect a slot to my object&#x27;s signal? on Thu, 06 Oct 2016 14:24:31 GMT]]></title><description><![CDATA[<p dir="auto">Hi Wieland.  Thanks for answering.</p>
<p dir="auto">Unfortunately, unless I'm missing something, that function doesn't seem to be what I want.  It lets me check the number of receivers but doesn't notify me when someone subscribes, is that right?</p>
<p dir="auto">I need to know <em><strong>right at the point someone connects to my signal</strong></em> that the connection has occurred.  I need to be able to intercept the connect() calls themselves in some way or at least be told about it right after.</p>
<p dir="auto">(Maybe there is some virtual function I could override...?).</p>
<p dir="auto">When the first client connects, I start my expensive logic that periodically sends out signals.</p>
]]></description><link>https://forum.qt.io/post/352383</link><guid isPermaLink="true">https://forum.qt.io/post/352383</guid><dc:creator><![CDATA[JMO_GS]]></dc:creator><pubDate>Thu, 06 Oct 2016 14:24:31 GMT</pubDate></item><item><title><![CDATA[Reply to Can I Intercept client calls to connect a slot to my object&#x27;s signal? on Thu, 06 Oct 2016 12:55:13 GMT]]></title><description><![CDATA[<p dir="auto">Hi! <code>int QObject::receivers(const char *signal) const</code> is exactly what you're looking for. See: <a href="http://doc.qt.io/qt-5/qobject.html#receivers" target="_blank" rel="noopener noreferrer nofollow ugc">http://doc.qt.io/qt-5/qobject.html#receivers</a></p>
]]></description><link>https://forum.qt.io/post/352348</link><guid isPermaLink="true">https://forum.qt.io/post/352348</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Thu, 06 Oct 2016 12:55:13 GMT</pubDate></item></channel></rss>