Re: Editing a file in Qt4
1. Open file for reading
1. Read file.
2. Populate lineEdits with current file content.
3. Close file.
When user selects "save" then:
1. Open file for writing with QIODevice::Truncate
2. Write lineEdit content to file.
3. Close file.
That is one way.
Another way would be to parse the file and the lineEdits, and write the differences in to the file, but that would be more complected than the above method.
Re: Editing a file in Qt4
Hi,
can you send a code snippet for QIODevice::Truncate..
Re: Editing a file in Qt4
What do you mean?
Your own code is a code snippet for it! - see QIODevice::open() documentation.