title: How do I move the text inside the icon in a QPushButton?
body: <p>I have created custom PyQt5 buttons that have an SVG icon. I to have clickable hexagons with text inside them. However, when I try to move the text to the left, it is hidden by the hexagon.</p>
  
  <p>I have tried moving the text to the left using padding, but this just hides the text.</p>
  
  <p>HexButton code:</p>
  
  <pre><code>class HexButton(QPushButton):
      def __init__(self, colour, parent=None):
          super(QPushButton, self).__init__(parent)
  
          # Convert hexagon svg into image
          qimage = QtGui.QImage.fromData(self.svg_hexagon(colour))
          qicon = QtGui.QPixmap(qimage)
          # Set the icon as the hexagon
          self.setIcon(QtGui.QIcon(qicon))
          # Set icon size as the entire thing
          self.setIconSize(QSize(48, 48))
          # Make the button invisible
          self.setStyleSheet("""
          border: none;""")
  
  
      def svg_hexagon(self, colour):
          svg_bytes = f'&lt;svg xmlns="http://www.w3.org/2000/svg" width="31" height="31"&gt;&lt;path stroke="none" fill="{COLOURS[colour]}" d="M12.5 1.2320508075689a6 6 0 0 1 6 0l7.856406460551 4.5358983848622a6 6 0 0 1 3 5.1961524227066l0 9.0717967697245a6 6 0 0 1 -3 5.1961524227066l-7.856406460551 4.5358983848622a6 6 0 0 1 -6 0l-7.856406460551 -4.5358983848623a6 6 0 0 1 -3 -5.1961524227066l0 -9.0717967697245a6 6 0 0 1 3 -5.1961524227066"&gt;&lt;/path&gt;&lt;/svg&gt;'
          return bytearray(svg_bytes, encoding='utf-8')
  </code></pre>
  
  <p>MainApplication</p>
  
  <pre><code>def main():
  
      app = QApplication(sys.argv)
      window = QWidget()
      layout = QHBoxLayout(window)
  
      button = HexButton("blank")
      button.setText("Nice")
      button.move(10, 10)
      layout.addWidget(button)
  
      window.show()
      sys.exit(app.exec_())
  </code></pre>
  
  <p>I expect a yellow hexagon with text inside.</p>