QTextStream provides a method to read a line (ASCII) which is QTextStream::readLine, but is there a way I can remove a specific line?

For instance, I have a text line with below values:

Qt Code:
  1. This is line 1
  2. This is line 2
  3. This is line 3
To copy to clipboard, switch view to plain text mode 


Is there anyway I can use QTextStream to delete line 2 ("This is line 2"), and well, maybe replace it with something else, which should result in:

Qt Code:
  1. This is line 1
  2. I replaced something here
  3. This is line 3
To copy to clipboard, switch view to plain text mode 

Thanks in advance!