<?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[Problem with signal&#x2F;slot from class]]></title><description><![CDATA[<p dir="auto">Hi there:<br />
I have issues getting a signal/slot working from a class. Does this class need to be a thread to accept signal/slots?</p>
<p dir="auto">In the main app I connect like this:</p>
<pre><code>mColorLib = new ColorLib(this);
    connect( mColorLib, &amp;ColorLib::signalTellUser, this, &amp;SpectraProof::slotTellUser, Qt::BlockingQueuedConnection );
</code></pre>
<p dir="auto">What I send from class:</p>
<pre><code>emit signalTellUser(tr("Warning:"), tr("File format not supported yet."));
</code></pre>
<p dir="auto">My class header:</p>
<pre><code>class ColorLib : public QObject
{
    Q_OBJECT

public:
    explicit ColorLib(QObject *parent = 0);


signals:
    void signalTellUser(QString title, QString message);

public:
    void open(QDir colorLibSubFolder);

};
#endif // COLORLIB_H
</code></pre>
]]></description><link>https://forum.qt.io/topic/126429/problem-with-signal-slot-from-class</link><generator>RSS for Node</generator><lastBuildDate>Sat, 16 May 2026 13:32:51 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/126429.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 07 May 2021 10:19:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Sat, 15 May 2021 15:48:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a>  ok - that will take time - and of course in a minimal it is working corecctly. This we have tested already in another thread a year ago.</p>
<p dir="auto">In the same project - slot/signal works if the class is derived with QThread and it does not if it  misses QThread.  Does this make a difference?</p>
]]></description><link>https://forum.qt.io/post/659827</link><guid isPermaLink="true">https://forum.qt.io/post/659827</guid><dc:creator><![CDATA[ademmler]]></dc:creator><pubDate>Sat, 15 May 2021 15:48:55 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Sat, 15 May 2021 13:39:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ademmler">@<bdi>ademmler</bdi></a> said in <a href="/post/659808">Problem with signal/slot from class</a>:</p>
<blockquote>
<p dir="auto">I can't upload here in the forum.</p>
</blockquote>
<p dir="auto">When it's minimal I would say it's below 50 lines of code so you can paste them here.</p>
]]></description><link>https://forum.qt.io/post/659816</link><guid isPermaLink="true">https://forum.qt.io/post/659816</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 15 May 2021 13:39:31 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Sat, 15 May 2021 12:28:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> thx for this suggestion. I can't upload here in the forum.</p>
]]></description><link>https://forum.qt.io/post/659808</link><guid isPermaLink="true">https://forum.qt.io/post/659808</guid><dc:creator><![CDATA[ademmler]]></dc:creator><pubDate>Sat, 15 May 2021 12:28:47 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Tue, 11 May 2021 15:15:02 GMT]]></title><description><![CDATA[<p dir="auto">Please provide a minimal, compilable example. Your code snippets don't help. Please show at least where you do the connect and emit the signal to see if you really call the correct object.</p>
]]></description><link>https://forum.qt.io/post/659185</link><guid isPermaLink="true">https://forum.qt.io/post/659185</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 11 May 2021 15:15:02 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Tue, 11 May 2021 13:36:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> I have the debug output at the correct spot.<br />
Right above the emit signal statement. Also no warnings about a "wrong" connect object ...<br />
It is really wired. My only idea ist that this class over takes an Object while the other (where it is working) over takes a Thread. Does it need to be a Thread?</p>
<p dir="auto">Not working:</p>
<pre><code>ColorLib::ColorLib(QObject *parent)
: QObject(parent)
{
}
</code></pre>
<p dir="auto">Working:</p>
<pre><code>MyMeasure::MyMeasure(QObject *parent):
    QThread(parent)
{
}
</code></pre>
]]></description><link>https://forum.qt.io/post/659163</link><guid isPermaLink="true">https://forum.qt.io/post/659163</guid><dc:creator><![CDATA[ademmler]]></dc:creator><pubDate>Tue, 11 May 2021 13:36:46 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Fri, 07 May 2021 16:32:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ademmler">@<bdi>ademmler</bdi></a> said in <a href="/post/658502">Problem with signal/slot from class</a>:</p>
<blockquote>
<p dir="auto">the class emits the signal and the slot is in the main app ...</p>
</blockquote>
<p dir="auto">Which functions triggers the signal? Are you sure the correct instance is used? Simply add some debug output or use a debugger to see what instance you're using where.</p>
]]></description><link>https://forum.qt.io/post/658558</link><guid isPermaLink="true">https://forum.qt.io/post/658558</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Fri, 07 May 2021 16:32:36 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Fri, 07 May 2021 12:57:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> the class emits the signal and the slot is in the main app ...<br />
I do the same with another class - same code lines and there it works ...<br />
Hence I do not recall find any difference.</p>
]]></description><link>https://forum.qt.io/post/658502</link><guid isPermaLink="true">https://forum.qt.io/post/658502</guid><dc:creator><![CDATA[ademmler]]></dc:creator><pubDate>Fri, 07 May 2021 12:57:39 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Fri, 07 May 2021 12:47:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ademmler">@<bdi>ademmler</bdi></a> said in <a href="/post/658448">Problem with signal/slot from class</a>:</p>
<blockquote>
<p dir="auto">What I send from class:</p>
</blockquote>
<p dir="auto">From where and when?</p>
]]></description><link>https://forum.qt.io/post/658499</link><guid isPermaLink="true">https://forum.qt.io/post/658499</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Fri, 07 May 2021 12:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Fri, 07 May 2021 12:45:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nagesh">@<bdi>nagesh</bdi></a> thx for oyur response. the problem still exists .</p>
<p dir="auto">connect( mColorLib, &amp;ColorLib::signalTellUser, this, &amp;SpectraProof::slotTellUser);</p>
<p dir="auto">What is the best way to debug slots/signals?<br />
The connect seems to be valid, because I do not get any complains while application launch.</p>
]]></description><link>https://forum.qt.io/post/658497</link><guid isPermaLink="true">https://forum.qt.io/post/658497</guid><dc:creator><![CDATA[ademmler]]></dc:creator><pubDate>Fri, 07 May 2021 12:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to Problem with signal&#x2F;slot from class on Fri, 07 May 2021 10:26:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ademmler">@<bdi>ademmler</bdi></a> said in <a href="/post/658448">Problem with signal/slot from class</a>:</p>
<blockquote>
<p dir="auto">Qt::BlockingQueuedConnection</p>
</blockquote>
<p dir="auto">remove the last argument and check it, let it be decided based on the signalling and receiver object context.</p>
<pre><code>Qt::BlockingQueuedConnection in this type of connection the signalling thread blocks until the slot returns. This connection must not be used if the receiver lives in the signalling thread, or else the application will deadlock.
</code></pre>
]]></description><link>https://forum.qt.io/post/658450</link><guid isPermaLink="true">https://forum.qt.io/post/658450</guid><dc:creator><![CDATA[nagesh]]></dc:creator><pubDate>Fri, 07 May 2021 10:26:51 GMT</pubDate></item></channel></rss>