Qt Stylesheets to inherit previous attributes.

  • I'm setting my app style to "cleanlooks" in general but now i need to change TAB border-top-color.

    When I'm touching "QTabBar::tab::selected" attribute QT is overriding whole attributes and in result im not getting what i wanted, i have to reimplement whole Qtabbar to be as like as in cleanlooks style but without the blue line,

    QTabBar::tab:selected {

    reimplementing whole qtabbar is going wrong because left margine has stucked out pixels which i cannot fix

    QTabBar::tab {
        background: #EEEBE6;
        border: 2px solid transparent;
        border-top-left-radius: 2px;
        border-top-right-radius: 2px;
        min-width: 8ex;
        padding: 2px;
        padding-left: 10px;
        padding-right: 10px;
        text-align: center;
    QTabBar::tab:selected, QTabBar::tab:hover {
    background: #EEEBE6;
    QTabBar::tab:selected {
    margin-top: 2px;
    QTabBar::tab:selected {margin-left: -4px; margin-right: -4px;}
    QTabBar::tab:first:selected { margin-left: 0; }
    QTabBar::tab:last:selected { margin-right: 0;  }
    TabBar::tab:only-one { margin: 0; }

    stucked out pixel image

    Can anyone help me with cleanlooks tabbar selected item reimplementation?

  • anyone?!

  • Lifetime Qt Champion


    If it's only a color question, did you check with QPalette ? It might be a bit lighter for that

  • @SGaist No Pallet is not able to change the border color, atleast i could not figure out how to do this.

  • Lifetime Qt Champion

    Which border are you referring to ?

    Can you post an image of how you would like your QTabBar to look exactly ?

Log in to reply

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