Originally Posted by
mcosta
can you post your code???
ba = fileIn->readAll();
qDebug() << ba;
qDebug() << ba.length();
fileIn->close();
acba = acba.append(key);
qDebug() << acba; //i hope here will go "thisisakey" appended
fileOut->write(acba); // i will fail save the same file as before because i have append it with key,
// but the result it is success, and it means there is no change.
fileOut->flush();
fileOut->close();
QByteArray ba;
QString inName = QFileDialog::getOpenFileName(this, "Load a file");
QFile *fileIn = new QFile(inName);
fileIn->open(QIODevice::ReadOnly);
ba = fileIn->readAll();
qDebug() << ba;
qDebug() << ba.length();
fileIn->close();
QByteArray acba = ba;
QString key = "thisisakey";
acba = acba.append(key);
qDebug() << acba; //i hope here will go "thisisakey" appended
QString outName = QFileDialog::getSaveFileName(this, "Save a file");
QFile *fileOut = new QFile(outName);
fileOut->open(QIODevice::WriteOnly);
fileOut->write(acba); // i will fail save the same file as before because i have append it with key,
// but the result it is success, and it means there is no change.
fileOut->flush();
fileOut->close();
To copy to clipboard, switch view to plain text mode
Bookmarks