I' using QTextStream class to write file which has already existed some texts.
and now,I want to replace the first line only.eg:
hey! //first line
wellcome to Qt's world! //second line
I want using "hello!" to replace "hey!". my code is
QFile file("/home/drcom.conf");
file.open(QFile::WriteOnly);
QTextStream out(&file);
out<<"hello!"<<endl;
the result is:
hello!
but what I want to achieve is:
hello!
wellcome to Qt's world!
the problem is the second line is cleared.how can I implement it ?if someone can tell me?thanks!