Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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.

    0_1522919734918_QTabBar_QDockWidget.png

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

    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)
    0_1522922357779_QDockWidget.png

    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.


Log in to reply