PDA

View Full Version : QStringList straight to file



freak
13th June 2006, 22:15
Is there a way to write a QStringList straight to file without the overhead of going each element of the QString list separate?

Thanks in advanced.

patrik08
13th June 2006, 22:31
join.........




qlistxmlfile.append("<?xml version=\"1.0\" ?>");
qlistxmlfile.append("<uri>"+pics_xml_fiel_browser+"</uri>");
qlistxmlfile.append("<icon>/user/images/icon/folder.png</icon>");
qlistxmlfile.append("<title>Pictures</title>");
qlistxmlfile.append("<src>"+pics_xml_fiel_browser+"</src>"); /* browser server path */
qlistxmlfile.append("<items>");
/* die aussen schleleife
qlistxmlfile.append("<resource id=\""+bildname+"\">");
die innen schleleife
qlistxmlfile.append("\t<uri>"+pathimage+bildname"</uri>");
qlistxmlfile.append("\t<title>"+bildname"</title>");
qlistxmlfile.append("\t<description>"++"</description>");
qlistxmlfile.append("\t<width>"++"</width>");
qlistxmlfile.append("\t<height>"++"</height>");
qlistxmlfile.append("\t<size>"++"</size>");
qlistxmlfile.append("</resource>");

*/
qlistxmlfile.append("</items>");
QString xml = QString(qlistxmlfile.join("\n"));

jacek
13th June 2006, 22:38
join.........
Please, post only relevant part of the code.

That is:
qlistxmlfile.append("<?xml version=\"1.0\" ?>");
qlistxmlfile.append("<uri>"+pics_xml_fiel_browser+"</uri>");
...
QString xml = QString(qlistxmlfile.join("\n"));