How can I copy one QByteArray at n-index of another QByteArray?
Unsolved
General and Desktop
-
@wost
when you useQDataStream
for reading and writing the nested QByteArray data, Qt takes care of all for you.
So that the nested QByteArrays have the correct size after reading them out again. -
QByteArray *arr = new QByteArray("abcd"); QByteArray *arr2 = new QByteArray("efgh"); QByteArray *arr3 = new QByteArray((QByteArray)(arr->mid(0, 2) + arr2->mid(0,3))); qDebug() << QString::fromStdString(arr3->toStdString()); = "abefg"
-
@wost said in How can I copy one QByteArray at n-index of another QByteArray?:
Will that work with readyRead? I'm getting the data through a QSerialPort.
so how do you ensure that you have already received the whole data you are looking for?