Hi guys I have this code but it just overwrite the file. How can I just add text to the file?
QFile file("E:/Qt/Qt codes/txt file/file");
if(!file.open(QFile::WriteOnly | QFile::Text)){
QMessageBox::warning(this,"Title","File not open.");
}
QTextStream out(&file);
QString text = ui->plainTextEdit_2->toPlainText();
out << text;
file.flush();
file.close();
Thanks.