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

Qt Code:
  1. void MyXML::save(){
  2.  
  3. QFile file(":/files/zoom.XML");
  4. if (!file.open(QIODevice::WriteOnly | QFile::Text))
  5. return;
  6.  
  7. QXmlStreamWriter xmlWriter(&file);
  8. xmlWriter.setAutoFormatting(true);
  9. xmlWriter.writeStartDocument();
  10.  
  11. xmlWriter.writeStartElement("record");
  12.  
  13. xmlWriter.writeAttribute("prop1",newProp1);
  14. ...
  15. ...
  16. xmlWriter.writeAttribute("propn",newPropn);
  17.  
  18. xmlWriter.writeEndElement();
  19. }
To copy to clipboard, switch view to plain text mode