[Interest] QSerialport EV_RXCHAR not emitted or catched while moving window

Samuel Gaist samuel.gaist at edeltech.ch
Thu Mar 15 14:45:15 CET 2012


Again: use the readyRead signal ? 

http://qt-project.org/doc/qt-4.8/qiodevice.html#readyRead

On 15 mars 2012, at 14:27, Riccardo Roasio wrote:

> Sorry..so what you think i have do do?
> 
> 
> 
> Il 15 marzo 2012 14:26, Samuel Gaist <samuel.gaist at edeltech.ch> ha scritto:
>> I must say, I don't understand your use of QSerialPort.
>> 
>> You are waiting on data coming from the serial port, aren't you ?
>> So, why not just connect to the readyRead signal ?
>> 
>> On 15 mars 2012, at 14:07, Riccardo Roasio wrote:
>> 
>>> the serial port class is this one:
>>> 
>>> http://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCwQFjAA&url=http%3A%2F%2Fgitorious.org%2Finbiza-labs%2Fqserialport&ei=8OhhT_vNGY6KhQeg6tieCA&usg=AFQjCNF7vwKcu_dJz8y-QE6ziYhoPe4uNw&sig2=adTbs9FuJPYZhrNXtnfALg
>>> 
>>> it expect a EV_RXCHAR event on receiving something on the serial port
>>> so it reimplements the QWidget event function:
>>> 
>>> bool WinSerialPortEngine::event(QEvent *e)
>>> {
>>> //   qDebug()<<"event "<<e<<" "<<e->type();
>>>    bool ret = false;
>>>    if (e->type() == QEvent::WinEventAct) {
>>>        if (EV_ERR & m_currentMask & m_setMask) {
>>>            m_parent->canErrorNotification();
>>>            ret = true;
>>>        }
>>> 
>>>        if (EV_RXCHAR & m_currentMask & m_setMask)
>>>        {
>>>            m_parent->canReadNotification();
>>>            ret = true;
>>>        }
>>> 
>>>        //FIXME: This is why it does not work?
>>>        if (EV_TXEMPTY & m_currentMask & m_setMask) {
>>>            m_parent->canWriteNotification();
>>>            ret = true;
>>>        }
>>>    }
>>>    else
>>>    {
>>>         ret = QWinEventNotifier::event(e);
>>>    }
>>> 
>>>    ::WaitCommEvent(m_descriptor, &m_currentMask, &m_ov);
>>>    return ret;
>>> }
>>> 
>>> the problem is that while receiving events like the
>>> QEvent::NonClientAreaMouseButtonPres on the gui thread it stop
>>> receivng EV_RXCHAR event on the serial port class
>>> 
>>> 
>>> 
>>> Il 15 marzo 2012 12:53, Samuel Gaist <samuel.gaist at edeltech.ch> ha scritto:
>>>> 
>>>> On 15 mars 2012, at 12:37, Riccardo Roasio wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> i have a program with :
>>>>> 
>>>>> - a main thread
>>>>> - a serial manager thread using Qserialport
>>>>> 
>>>>> i noticed that if i move the main gui the EV_RXCHAR event is not fired
>>>>> or cached...
>>>>> 
>>>>> what's wrong?
>>>>> 
>>>>> thanks,
>>>>> Riccardo
>>>>> _______________________________________________
>>>>> Interest mailing list
>>>>> Interest at qt-project.org
>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>> 
>>>> Hi,
>>>> 
>>>> With so few information, we won't be really be able to help you.
>>>> But here is a few questions:
>>>> - How is your serial manager thread implemented ? (My guess: run reimplementation)
>>>> - Do you have signals slots directly connected ?
>>>> 
>>>> Hope this helps
>>>> Samuel
>>>> 
>>>> PS:
>>>> Did you also read this article ?
>>>> http://labs.qt.nokia.com/2010/06/17/youre-doing-it-wrong/
>>>> 
>>>> And there where a few discussions on the qt-nokia mailing list last year about threading, you might want to look for them
>>>> 
>> 




More information about the Interest mailing list