QByteArray data("Hello world!"); data = data.toUpper();
QFile file1("file1.txt"); QFile file2("file2.txt"); file1.open(QIODevice::ReadOnly); file2.open(QIODevice::WriteOnly); QByteArray data = file1.readAll(); file2.write(data);
QByteArray data("\x01\x02\x03\x04", 4); int value = qFromBigEndianIn the above example, qFromBigEndian is a function provided by Qt that converts a byte array to an integer in big-endian byte order. The package library for QByteArray is QtCore in the Qt framework.(data);