Qt C++ QString to QByteArray Conversion
I guess you should use: QString::fromUtf8(const QByteArray &str) Or: QString::QString(const QByteArray &ba) to convert QByteArray to QString, then write it into file by QTextStream. After that, read file by QTextStream, use: QString::toUtf8() to convert QString to QByteArray. QString::QString(const QByteArray &ba) Constructs a string initialized with the byte array ba. The given byte array is converted … Read more