How to signal a slot in another thread in Qt
<p>I have written a simple signal slot application using Qt. I want to send a signal to another thread that is runs out of the main thread.</p>

<p>Here is my code:</p>

<pre><code>class Thread1 : public QThread
{
    Q_OBJECT


    void run()
    {
        exec();
    }
public:
    Thread1(QObject* parent);

public slots:
    void a()
    {
        qInfo()&lt;&lt;QThread::currentThreadId();
    }
};
class Object : public QObject
{
    Q_OBJECT
public:
    Object(){}
    void start()
    {
        qInfo()&lt;&lt;QThread::currentThreadId();
        Thread1* thread = new Thread1(this);
        connect(this,SIGNAL(a()),thread,SLOT(a()));
        thread-&gt;start();
        emit a();
    }

signals:
    void a();
};
</code></pre>

<p>But it returns:</p>

<pre><code>0x7f9851c988c0
0x7f9851c988c0
</code></pre>

<p>How can I call a signal that outputs another threadID?</p>