Qt:Using QByteRef with an index pointing outside the valid range of a QByteArray


解决:

QString a;//QByteArray
a.resize(10);