write()函数会返回实际写入的个数,你可以用返回值验证是否写入。
qint64 QIODevice::write(const char *data)
This is an overloaded function.
Writes data from a zero-terminated string of 8-bit characters to the device. Returns the number of bytes that were actually written, or -1 if an error occurred. This is equivalent to