title: QImage is null while reading image from resources
body: <p>I am developing a simple fps shooter for a college project. I am using C++, Qt and OpenGL and I'm having a problem during texture loading. I put my textures into resource file. After loading, QImage object which stores a texture, is null.
  Here is my resource file:</p>
  
  <pre><code>&lt;RCC&gt;
      &lt;qresource prefix="/sounds"&gt;
          &lt;file alias="rifle"&gt;rifle.wav&lt;/file&gt;
      &lt;/qresource&gt;
      &lt;qresource prefix="/textures"&gt;
          &lt;file alias="ground"&gt;ground00.tga&lt;/file&gt;
          &lt;file alias="sky_back"&gt;sky_back.tga&lt;/file&gt;
          &lt;file alias="sky_front"&gt;sky_front.tga&lt;/file&gt;
          &lt;file alias="sky_left"&gt;sky_left.tga&lt;/file&gt;
          &lt;file alias="sky_right"&gt;sky_right.tga&lt;/file&gt;
          &lt;file alias="sky_up"&gt;sky_up.tga&lt;/file&gt;
          &lt;file alias="wall05"&gt;wall05.tga&lt;/file&gt;
          &lt;file alias="wall06"&gt;wall06.tga&lt;/file&gt;
          &lt;file alias="wall07"&gt;wall07.tga&lt;/file&gt;
          &lt;file alias="wall08"&gt;wall08.tga&lt;/file&gt;
          &lt;file alias="wall09"&gt;wall09.tga&lt;/file&gt;
      &lt;/qresource&gt;
  &lt;/RCC&gt;
  </code></pre>
  
  <p>Function which loads texture:</p>
  
  <pre><code>void GLWidget::load_texture(const QString  &amp; file, GLuint texHandle)
  {
     //load image
     QImage tex(file);
     if(tex.isNull())
     {
         std::cerr&lt;&lt;"File "&lt;&lt;file.toStdString()&lt;&lt;" not found"&lt;&lt;std::endl;
         return;
     }
  
     tex = QGLWidget::convertToGLFormat(tex);
     int w = tex.width();
     int h = tex.height();
  
     //generate the texture
     glGenTextures(1,&amp;texture[texHandle]);
     glBindTexture(GL_TEXTURE_2D,texture[texHandle]);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);
     glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_NEAREST);
     glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,w,h,0,GL_RGBA, GL_UNSIGNED_BYTE,(GLvoid*)tex.bits());
  }
  </code></pre>
  
  <p>Unfortunately, when I try to call this function it prints "File ... not found" and returns.
  I tried to call this function:</p>
  
  <pre><code>load_texture(":/textures/ground00.tga",0);//using filename
  load_texture(":/textures/ground",0);//using alias
  </code></pre>
  
  <p>however, both calls fail. QImageReader supports tga files, "tga" is in output of</p>
  
  <pre><code>qDebug() &lt;&lt; QImageReader::supportedImageFormats ();
  </code></pre>
  
  <p>edit:
  I have added following lines on top the <code>load_texture</code> function</p>
  
  <pre><code>if(QFile::exists(file))
  {
      std::cout&lt;&lt;"File "&lt;&lt;file.toStdString()&lt;&lt;" exists"&lt;&lt;std::endl;
  }
  </code></pre>
  
  <p>and for case when i am using resource alias <code>load_texture(":/textures/ground",0);</code> it returns true</p>