title: How can I center the icons in a QTabBar?
body: <p>I'm trying to change the style for a QTabWidget. I would like to reduce the gap between the icon and text in each tab, and center both.</p>
  
  <p>This is what I have now:</p>
  
  <p><a href="https://i.stack.imgur.com/9MLkR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9MLkR.png" alt="enter image description here"></a></p>
  
  <p>This is what I want:</p>
  
  <p><a href="https://i.stack.imgur.com/wMW1Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wMW1Y.png" alt="enter image description here"></a></p>
  
  <p>My current stylesheet is:</p>
  
  <pre><code>stylesheet = """
      QTabBar {
          background: %s;
      }
  
      QTabBar::tab {
          background: %s;
          height: 60px;
          width: 200px;
          font-family: Ubuntu;
          font-weight: bold;
          font-size: 14px;
          color: %s;
      }
  
      QTabBar::tab:selected {
          background: white;
      }
  
      QTabWidget {
          background: white;
      }
  
      QTabWidget::pane {
          background: white;
          border: none;
      }
  
      """ % (colors.light_gray,    # tabbar bg where there are no tabs
             colors.light_gray,    # tab bg
             colors.dark_gray,)    # text color
  </code></pre>
  
  <p>The icons are set in the code:</p>
  
  <pre><code>class ImageProcessingPage(qt.QWidget):
  
      def __init__(self, parent=None):
          super().__init__(parent)
          self.setStyleSheet(stylesheet)
  
          layout = qt.QHBoxLayout()
          self.setLayout(layout)
  
          self.tabWidget = qt.QTabWidget()
          layout.addWidget(self.tabWidget)
  
          self.tabWidget.addTab(qt.QLabel("Placeholder for edition"),
                                icons.getQIcon("pic-edit-gray"),
                                "Edition")
          self.tabWidget.addTab(qt.QLabel("Placeholder for edition"),
                                icons.getQIcon("roi-gray"),
                                "ROI")
          self.tabWidget.addTab(qt.QLabel("Placeholder for edition"),
                                "Segmentation")
  </code></pre>
  
  <p>I have tried adding some padding to <code>QTabBar::tab</code>, which worked for adding some space on the left side of the icon, but did not reduce the amount of space between icon and text.</p>