qt emit singal in windows threads
<p>I am developing one QT application. As per my requirement, I need to create one Windows thread where I have to emit one signal to notify to my function which is in different class. When i am trying to emit a signal, I am getting an error: <code>cannot call member function 'void Device::DataRecieved(QByteArray)' without object emit DataRecieved(Rxdata);</code>. Are there any possibilities to emit QT signal from the Windows thread. Thanks.<br>
Here is my code: </p>

<pre><code>DWORD WINAPI Device::RxThread(LPVOID par)
{
    XLstatus        xlStatus;
    unsigned int    msgsrx = RECEIVE_EVENT_SIZE;
    XLevent         xlEvent;
    char            tmp[100];
    QString         str;
    g_bThreadRun = TRUE;
    TStruct *g_th;
    g_th = (TStruct*)par;
    while(g_bThreadRun) {
        WaitForSingleObject(g_th-&gt;hMsgEvent, 1000);
        xlStatus = XL_SUCCESS;
        while(!xlStatus) {
            msgsrx = RECEIVE_EVENT_SIZE;
            xlStatus = xlReceive(g_th-&gt;xlPortHandle, &amp;msgsrx, &amp;xlEvent);
            if(xlStatus != XL_ERR_QUEUE_IS_EMPTY)
            {
                switch(xlEvent.tag)
                {
                    // CAN events
                case XL_SYNC_PULSE:
                    break;
                case XL_TRANSCEIVER:
                    break;
                    // LIN events   
                case XL_LIN_NOANS:
                    break;
                case XL_LIN_MSG: {
                    QString         str1;
                    QString         sData;
                    str = "RX: ";
                    if(xlEvent.tagData.linMsgApi.linMsg.flags &amp; XL_LIN_MSGFLAG_TX) str = "TX: ";
                    str1 = "";
                    for(int i = 0; i&lt;xlEvent.tagData.linMsgApi.linMsg.dlc; i++)
                    {
                        str1 = QString("%1").arg(xlEvent.tagData.linMsgApi.linMsg.data[i], 0, 16);
                        sData = sData + str1;
                    }
                    qDebug() &lt;&lt; "Receiced Data is" &lt;&lt; sData;
                    Rxdata.append(sData);
                    Device::sample();
                    emit DataRecieved(Rxdata);
                    break;
                }
                case XL_LIN_SLEEP:
                    break;
                case XL_LIN_ERRMSG:
                    break;
                case XL_LIN_SYNCERR:
                    break;
                case XL_LIN_WAKEUP:
                    break;
                default:
                    qDebug() &lt;&lt; "Nothing found";
                    break;
                }
                ResetEvent(g_th-&gt;hMsgEvent);
            }
        }
    }
    return NO_ERROR;
}
</code></pre>