i am using QT 4 ..and now i want to change in text file which stored in that folder.
for example "a.txt"......i wana find text and replace text when i push "ENTER" button.
plz reply i m in trouble
i am using QT 4 ..and now i want to change in text file which stored in that folder.
for example "a.txt"......i wana find text and replace text when i push "ENTER" button.
plz reply i m in trouble
I'm not 100% sure of what you mean. Do you want to open a file, replace some text in it and then write it back to the same file?
In that case, I suggest that you start with a QFile, read its contents into RAM (I assume that the file is reasonably sized) using readAll, do the replacement (QString::replace might work), and then re-open the file for writing and write it all back there.
thx 4 rply..............actually i mean to say that i have created interface like that
enter IP Address:.............................
enter host name:...........................
:SAVE BUTTON:
when we click it then these two fields save in file, which is stored in file...
this file is same like that fields such as...
IP Address=_._._._
Host name=_____
etc....
So i want to code for "Find" record and replace record through interface.
plz reply
You could use a QSettings object.
Bookmarks