Results 1 to 2 of 2

Thread: How can I edit resource file?

  1. #1
    Join Date
    Jan 2016
    Posts
    81
    Thanks
    31
    Qt products
    Qt5
    Platforms
    Windows

    Default How can I edit resource file?

    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 

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,499
    Thanked 277 Times in 272 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I edit resource file?

    Resource file is read only because this is a part of executable.

  3. The following user says thank you to Lesiok for this useful post:

    neda (12th April 2016)

Similar Threads

  1. Replies: 2
    Last Post: 18th March 2016, 11:51
  2. Cannot copy js file from resource to file system
    By kalma in forum Qt Programming
    Replies: 1
    Last Post: 1st January 2015, 15:10
  3. resource file
    By kavinsiva in forum Newbie
    Replies: 4
    Last Post: 18th August 2009, 22:28
  4. Resource file in Qt4.4.0
    By jml in forum Qt Tools
    Replies: 0
    Last Post: 6th May 2008, 18:01
  5. Resource file in a lib
    By Rodrigo in forum Qt Programming
    Replies: 4
    Last Post: 25th June 2007, 15:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.