title: C++ write to resource file with qfile (QIODevice::write (QFile,"x"): device not open)
body: <p>i have the following problem, i have an resource file called data.txt and i want to open it with write permission.
  Im using QFile and QTextStream to work with it.
  I can only open the File with ReadOnly Acces but not with ReadWrite or WriteOnly acces.
  Export functions with similar code working fine its only not working on the resource file.</p>
  
  <p>I already tried to change the front slashes to double backslashes, i runned hunderd times the qmake and rebuild, i restartet my computer and resotre the resource file.
  I already checked alot of entries on Stack but wasnt able to find one that resolves my problem. (Most questions were spelling issues like only one backslash).</p>
  
  <pre><code>QFile file(":/savelocation/data.txt");
  if (!file.exists())
  {
      qDebug()&lt;&lt;"File not exist";
  }
  
  file.open(QIODevice::ReadWrite | QIODevice::Text);
  
  if (file.isOpen())
  {
      qDebug()&lt;&lt;"File is open";
      QTextStream out(&amp;file);
      out&lt;&lt; "something" &lt;&lt; endl;
  }
  else
  {
      qDebug()&lt;&lt;"File is not open";
  }
  file.close();
  file.open(QIODevice::ReadOnly);
  if (file.isOpen())
  {
      qDebug()&lt;&lt;"File is open as read only";
  }
  else
  {
      qDebug()&lt;&lt;"File is not open as read only";
  }
  file.close();
  </code></pre>
  
  <p>Actual result:</p>
  
  <p>My Application output of the code:
  File is not open
  File is open as read only
  Its only possible to open it as ReadOnly for me.</p>
  
  <p>Before i implemented the if i got the following output:</p>
  
  <pre><code>QIODevice::write (QFile,":/savelocation/data.txt"): device not open
  </code></pre>
  
  <p>Expected result:</p>
  
  <p>The file would be opened with write access.</p>
  
  <p>Thanks in advance.</p>