Chapter 6. Using Style Sheet for the Tab Bar

The default style sheet for the tab bar sets the minimum and maximum tab widths. The user can create a .css file and have Konsole use that as the style sheet for the tab bar. In the .css file, the widget to use is QTabBar::tab.

For more information, consider reading Qt™ Style Sheets

Examples:

  • Change the selected tab's background to a light gray

    QTabBar::tab:selected {
        background: #999999
    }
    

  • Change the selected tab's text to red

    QTabBar::tab:selected {
        color: red
    }
    

  • All tabs will be at least 200 pixels in width

    QTabBar::tab {
        min-width: 200px
    }
    

  • Only the selected tab will be at least 200 pixels in width

    QTabBar::tab::selected {
        min-width: 200px
    }
    

  • Any of these can be combined in one file

    QTabBar::tab::selected {
        background: #999999;
        color: red;
        min-width: 200px;
    }
    QTabBar::tab {
        min-width: 100px
    }