I'm using a QTabWidget where I only want to use icons on the tabs and no text. I'm using some stylesheet to style my tabs. The problem is that the icon doesn't show up centered, instead it's to the left in the tab. I can't figure out how to make it show up centered. In the Designer Editor the icon is centered but not in the real app as you can see in the picture.

You can see both my stylesheet and a picture of the tabs below.

Tabs:


Stylesheet:
Qt Code:
  1. QTabWidget::pane {
  2. border-top: 0px;
  3. }
  4.  
  5. QTabBar::tab {
  6. border: 1px solid #333;
  7. border-radius: 8px;
  8. color: #333;
  9. padding: 5px 5px 5px 5px;
  10. margin: 0px 2px 0px 2px;
  11. background: #fff;
  12. }
  13.  
  14. QTabBar::tab:selected {
  15. border-color: #000;
  16. background: #f1f1f1;
  17. }
To copy to clipboard, switch view to plain text mode