title: Qt Image from resource file
body: <p>I'm trying to insert an image to my program via resource file, which is like:</p>
  
  <pre><code>&lt;RCC&gt;
      &lt;qresource prefix="/"&gt;
          &lt;file&gt;green.png&lt;/file&gt;
          &lt;file&gt;other files&lt;/file&gt;
      &lt;/qresource&gt;
  &lt;/RCC&gt;
  </code></pre>
  
  <p>and when I'm trying to load it using QImage or QPixmap, like:</p>
  
  <pre><code>QImage *green = new QImage(":/green.png");
  if(green-&gt;isNull()) qDebug("null");
  </code></pre>
  
  <p>I always see that null message, indicating that I'm doing something wrong. One solution may be using absolute path like</p>
  
  <pre><code>"C:\\Users\\user\\Documents\\project\\green.png",
  </code></pre>
  
  <p>which works of course, but I'd prefer implement it using resource file. Could you please give me some advice?</p>