Qt Code:
stream << document.toString(); serverList.close();To copy to clipboard, switch view to plain text mode
how can i get it to overwrite the file and not append to it
Qt Code:
stream << document.toString(); serverList.close();To copy to clipboard, switch view to plain text mode
how can i get it to overwrite the file and not append to it
how would i open it in overwrite ?
<< appends
whats the alternative ?
Rewind the device before you write to it again or reopen the device.
like seek(0)
I've tried serverList.seek(0) but with no success i also tried resize but that failed as well
Qt Code:
{ qDebug() << "Failed to open file for write"; } else { serverList.seek(0); stream << document.toString(); serverList.close(); }To copy to clipboard, switch view to plain text mode
Last edited by Prophet; 21st June 2012 at 17:09.
ok so apparently its not the file thats the problem, its document.toString() that once run again is appended to document.. i have tried to document.clear() after the stream << document.toString() but that still does not solve my issue any thoughts ?
Bookmarks