PDA

View Full Version : How can I edit resource file?



neda
12th April 2016, 06:40
Hi

I have a XML file in some folder of my project.

I can to read the file but I am not able to write.

I have this error:

QIODevice::write (QFile, ":\files\zoom.XML"): device not open


void MyXML::save(){

QFile file(":/files/zoom.XML");
if (!file.open(QIODevice::WriteOnly | QFile::Text))
return;

QXmlStreamWriter xmlWriter(&file);
xmlWriter.setAutoFormatting(true);
xmlWriter.writeStartDocument();

xmlWriter.writeStartElement("record");

xmlWriter.writeAttribute("prop1",newProp1);
...
...
xmlWriter.writeAttribute("propn",newPropn);

xmlWriter.writeEndElement();
}

Lesiok
12th April 2016, 07:54
Resource file is read only because this is a part of executable.