title: How to use qrc in c++ and QML application?
body: <p>I have written a Qt Quick Desktop application in c++ qnd Qt Creator(QML) on Windows7. Now
  I have to deploy it, and I need to hide the qml files and the images(means: to put them in resources and etc.)</p>
  
  <p>I've read that there is a great way to do that with .qrc files. I read the documentation about those files, and created one for my application, which looks like this:</p>
  
  <pre><code>&lt;RCC&gt;
  &lt;qresource prefix="/"&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/myMain.qml&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/PressAndHoldButton.qml&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/TextButton.qml&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/advancedsettings.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/cnruninstall.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/dialog_cancel.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/folder_explore.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/gnome_session_switch.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/mail2_send.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/Picture1.png&lt;/file&gt;
      &lt;file&gt;qml/GenericHostApplicationQML/content/pics/Picture2.png&lt;/file&gt;
  &lt;/qresource&gt;
  </code></pre>
  
  <p></p>
  
  <p>In the main.cpp, I'm loading the Main.qml file like:</p>
  
  <pre><code>int main(int argc, char *argv[])
  {
     QApplication app(argc, argv);
     QDeclarativeView view;
     view.setSource(QUrl::fromLocalFile("qml/GenericHostApplicationQML/myMain.qml"));
     view.show();
     return app.exec();
  }
  </code></pre>
  
  <p>I tried to read the myMain.qml file from the Resources.qrc like:</p>
  
  <pre><code>view.setSource(QUrl(":/qml/GenericHostApplicationQML/myMain.qml"));//I added the ":/"
  </code></pre>
  
  <p>but I've got this error:</p>
  
  <pre><code>file:///qml/GenericHostApplicationQML/myMain.qml: File not found 
  </code></pre>
  
  <p>and when I tried this:</p>
  
  <pre><code>view.setSource(QUrl::fromLocalFile(":/qml/GenericHostApplicationQML/myMain.qml"));
  </code></pre>
  
  <p>I'm getting this:</p>
  
  <pre><code>file:///C:/Users/ayalafre/Desktop/ghaQML/GenericHostApplicationQML-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Release/:/qml/GenericHostApplicationQML/myMain.qml: File not found
  </code></pre>
  
  <p>It seems like my Qt doesn't know what to do with:":/".</p>
  
  <p>I have to use the .qrc file in:</p>
  
  <ul>
  <li>Loading the myMain.qml file</li>
  <li>Using import to qml files in myMain.qml</li>
  <li>Using images in my qml files</li>
  </ul>
  
  <p>Could you explain to me what's wrong??
  and what I have to do in order to use the .qrc in both c++ and qml?</p>
  
  <p>Thanks a lot:)</p>