title: Drawing QPushButton text off the button
body: <p>I am creating a custom QPushButton.  If the button has an icon I want the icon centered on the button.  If the button has text I want the text centered on the button.  I can handle both of those cases.  If the button contains both an icon and text I want the icon centered and the text drawn below the button, outside the button rectangle.  I am drawing the button image using border-image in a stylesheet.  </p>
  
  <p>Inside MyPushButton::paintEvent() I calculate a rectangle and draw the icon using:</p>
  
  <pre><code>    style()-&gt;drawItemPixmap(&amp;p, iconRect, Qt::AlignLeft | Qt::AlignVCenter, 
          this-&gt;icon().pixmap(iconRect.size()));
  </code></pre>
  
  <p>I then calculate a text rectangle below the button and do this:</p>
  
  <pre><code>    style()-&gt;drawItemText(&amp;p, textRect, Qt::AlignCenter, (this-&gt;palette()),
          true, this-&gt;text(), QPalette::ButtonText );
  </code></pre>
  
  <p>but the text is not visible.</p>
  
  <p>I think this must have something to do with designated "drawable" area, but I can't figure out how to extend that area so that the button image doesn't to fill the area where I want to place the text.  </p>
  
  <p>I can do this with a QStyle::drawControl() overload but I'm not sure why.  When I trace the code into the CE_PushButtonLabel case the myStyle->rect has already been resized to be large enough to fit the button image and the text.</p>