Edit text in File - QTCreator : 
HELP QTCreator 

In the program records various information and would like to edit two in one file, the user will type in a lineEdit and will swap in the file

My code:


    QString valor = ui->edtRValor->text();
    QDate dateIn = ui->dateRInicial->date();
    QString dataInicio = dateIn.toString();
    QDate dateFi = ui->dateRFim->date();
    QString FimDate = dateFi.toString();
    
     QFile arch("C:\\Users\\Caio\\Documents\\cadastrarQuarto.txt");
         if(!sr.open(QIODevice::ReadOnly | QIODevice::Text))
                 return;
      QTextStream out(&arch);

How do I get the value typed and swap with a value that is written in the file?
My file:

231-1º-40-sáb jan 1 2000-qua jan 5 2000-160-2
441-4º-40-sáb jan 1 2020-qua jan 5 2200-190-8