{ //you can send a message or throw error signal here
return;
}
while (!in.atEnd())
{
line.append(in.readLine());
}
lineedit.replace("StorageFolder=","Storage Folder Path"); //first arg is text that, which will
//gone a be change and second arg is text will replace the other one...
QFile file(iplogini);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{ //you can send a message or throw error signal here
return;
}
QTextStream in(&file);
QStringList line;
while (!in.atEnd())
{
line.append(in.readLine());
}
QString lineedit =line.at(4);
lineedit.replace("StorageFolder=","Storage Folder Path"); //first arg is text that, which will
//gone a be change and second arg is text will replace the other one...
To copy to clipboard, switch view to plain text mode
First open file, if file exist
second read file, line by line, and write each line to a string list element
third if your text file will not be change (my file is a static ini file) and if you now that which line you want to replace, we can get it from qstringlist elements with "at()" public function
so if i can get the line, which i wanted, i can write in another string, after that with replace function i can replace char to in.
Sorry for bad english!
hope this help
Bookmarks