Important: Please read the Qt Code of Conduct -

Stylesheet and QTabBar - which element is this?

  • Pictured in this screenshot of a QTabBar (bottom tabs!), how do I address the marked border line?
    alt text
    It does not seem to be QTabBar-border or QTabBar::pane-border.

    Here's my qss-code:

    QTabBar {
        background: #f3f3f3;
    QTabBar::tab {
        background-color: white;
        border: 1px solid #cccccc;
        min-width: 30px;
        padding: 2px;
        padding-left: 5px;
        padding-right: 5px;
        margin-left: 2px;
    QTabBar::tab:first {
        margin-left: 0px;
    QTabBar::tab:selected {
        border-top-color: white;
    QTabBar::tab:!selected {
        margin-bottom: 2px;

    These tabs are created by "tabifying" QDockWidgets, so I'm not sure whether or not that's actually a complete QTabWidget, or just a QTabBar.

    Any suggestions?

  • I have the same problem, When i tabifyDockWidgets, Tabbar will occure and I can't find QSS can modify this line's color.


    and below is the ui file, anyone can use it to test this problem. the stylesheet is in the mainwindow.

    look at the picture below
    blue color : QDockWidget > QWidget border : 5px solid rgb(0, 0, 255)
    green color : QTabBar background : rgb(0, 255, 0)
    read color : QTabBar border : 5px solid rgb(255, 0, 255)

    then, the gray line is still exist. looks like it is not a part of QDockWidget or QTabBar.

    Notice: The QTabbar border-top only have 4px, but border-bottom have 5px.

  • I have the same problem too. try adding

    QTabBar {
        qproperty-drawBase: 0;

    btw, if DockWidgets will be dragged, look this: topic/59450

Log in to reply