title: Qt Image won't show up in button
body: <p>I am creating a Qt application and I have an image that I want to use for a button instead of text. Unfortunately all that shows up is an empty button.</p>
  
  <p>I've tried two different methods to get it to show up with the same results for both methods.</p>
  
  <p>Code for Method 1:</p>
  
  <pre><code>ui-&gt;setupUi(this);
  
  QPixmap pix(":/svg/resources/menu.svg");
  int w = ui-&gt;menuButton-&gt;width();
  int h = ui-&gt;menuButton-&gt;height();
  ui-&gt;menuButton-&gt;setMask(pix.scaled(w,h,Qt::KeepAspectRatio).mask());
  </code></pre>
  
  <p>I found the info for the second method here: <a href="https://stackoverflow.com/questions/18328131/adding-image-to-qpushbutton-on-qt?s=1|46.1815">Adding image to QPushButton on Qt</a></p>
  
  <p>Code for Method 2:</p>
  
  <pre><code>ui-&gt;setupUi(this);
  
  QIcon icon(":/svg/resources/menu.svg");
  ui-&gt;menuButton-&gt;setIcon(icon);
  </code></pre>
  
  <p>Could someone please help me figure out why my image isn't showing up and the button is just empty?</p>