fix QByteArray allocation.