@donquixote said in Serial port data loss:
I used it because i thought maybe the problem is that new incoming data is interrupting the function before the previous one has not finished yet. The problem was still in there before that.
Slots are not interrupted. They are called one by one from the event loop in the background. Think of your slots are like a subroutine that is called from main if there is work to do.
process data and block serial signals at the time
QT'll continue to buffer data at the time
And I guess that will not work out. Even if it works on one platform, it may fail on another one.
OK, got your idea. That should be the problem since i don't wait for readyread signal in the loop, right?
Yeah, but don't wait for readyRead, leave the slot and give Qt the possibility to process the data. It will call your slot again once new data is ready.
Regards