How to set QTabBar by objectName in QSS ?



  • One QTabBar need border-bottom, another QTabBar do not need.

    setStyleSheet("QTabWidget::pane { border:0; }"
                  "QTabWidget::tab-bar { alignment:center; }"
                  "QTabBar:tab { width:90px; height:40px; font-size:15px; }"
                  "QTabBar::tab:selected { color:rgb(0,131,221); }"
                  "#tabWidget QTabbar::tab:selected { border:none; border-bottom:1px solid rgb(0,131,221); }");
    tabWidget = new QTabWidget;
    tabWidget->setObjectName("tabWidget");
    QTabWidget *repertory = new QTabWidget;
    repertory->setObjectName("repertory");
    

  • Lifetime Qt Champion

    Hi,

    The ID selector follows this syntax: QWidget#widgetObjectName.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.