Two things.

No data is sent or received until your code returns to the Qt event loop. From what I can see, your interface code goes into a busy wait loop more-or-less guaranteeing that Qt never gets a chance.

When you send or receive data (serial or network) it may not arrive at the other end in the same chunks it was sent. You may get neat whole packets but it would be unwise to rely on this. You seem to be using ReadData to handle incoming bytes. That code must accommodate partial packets and not (as appears to be the case) assume a whole packet at the start of the buffer.