The `readAll` function may return an empty `QByteArray`, so please make sure it is not empty before checking its first character.

Also, please adhere to the general coding style and put a space after `if` and `for`.