title: set an image to a qt pushbutton
body: <p>I tried to set an image to a Qt pushbutton using this widely known code.</p>
  
  <pre><code>QPixmap *pic = new QPixmap(":/images/logo.png");
  QIcon *icon = new QIcon(*pic);
  ui-&gt;pushButton-&gt;setIcon(*icon);
  ui-&gt;pushButton-&gt;setIconSize(QSize(pic-&gt;width(), pic-&gt;height()));
  </code></pre>
  
  <p>Here's my qrc file</p>
  
  <pre><code>&lt;RCC&gt;
      &lt;qresource prefix="/images"&gt;
          &lt;file&gt;images/logo.png&lt;/file&gt;
      &lt;/qresource&gt;
  &lt;/RCC&gt;
  </code></pre>
  
  <p>Even though the program compiles, always a runtime exception occurs at </p>
  
  <pre><code>QPixmap *pic = new QPixmap(":/images/logo.png");
  </code></pre>
  
  <p>When I tried printing *pic on output console, it showed that pic =  QPixmap(QSize(0, 0) ). i.e. it is null. Any ideas as to where I went wrong?</p>
  
  <p>Thanks in advance!</p>