This is a little tricky because you need space to have been allocated for readline() to copy into.
You can create a QString with an initial size but personally I would allocate a char* with a fixed reasonable buffer size and then create the QString from that - it makes it a lot clearer when you are debugging.