Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Get 1px bottom border of QTabBar to fill full width of QTabWidget



  • Hello!

    Does anyone know how to get the bottom border of QTabBar to fill the full width of a QTabWidget? The attached screenshot shows how this is not happening when the QTabWidget is wider than the width of the QTabBar.

    Here is my stylesheet. PopUp is the QWidget subclass where there are enough tabs to fill its child QTabWidget.

    QTabBar {                                                                                                                                                                       
        border-bottom: 1px solid #d0cfd1;                                                                                                                                           
    }                                                                                                                                                                               
    QTabBar::tab {                                                                                                                                                                  
        background: transparent;                                                                                                                                                    
        border-right: 1px solid #d0cfd1;                                                                                                                                            
        border-bottom: #d0cfd1;                                                                                                                                                     
        min-width: 8ex;                                                                                                                                                             
        font-size: 10px;                                                                                                                                                            
    }                                                                                                                                                                               
    QTabBar::tab:selected {                                                                                                                                                         
        color: blue;                                                                                                                                                                
        font-size: 11px;                                                                                                                                                            
    }                                                                                                                                                                               
    QTabBar::tab:first {                                                                                                                                                            
        border-left: 0;                                                                                                                                                             
        border-top-left-radius: 5px;                                                                                                                                                
    }                                                                                                                                                                               
    QTabBar::tab:last {                                                                                                                                                             
        border-right: 0;                                                                                                                                                            
        border-top-right-radius: 5px;                                                                                                                                               
    }                                                                                                                                                                               
    PopUp QTabWidget {                                                                                                                                                              
        border-top-left-radius: 5px;                                                                                                                                                
        border-top-right-radius: 5px;                                                                                                                                               
        background-color: transparent;                                                                                                                                              
    }                                                                                                                                                                               
    

    Thanks!

    0_1532013983601_2018-07-19_08-24-23.jpg


  • Qt Champions 2017

    I don't think this is possible, sadly.


Log in to reply