Question

So i have a fairly simple style sheet to change the look of the tabs in my Qt app (i'm using PySide, but it shouldn't make much, if any, difference); here it is:

QWidget{
    background: gray;
}

QTabBar{
    background: gray;
}

QTabBar::tab {
    background: lightgray;
    padding: 10 10 5 10;
    font-size: 14px;
    color:  gray;
}

QTabBar::tab:selected {
    background:  gray;
    color: white;
}

If i just use this; then I get an ugly line at the end of the tab - like this: (this is the top right corner of the app - if you resize it so that it goes beyond the size of the tabs)

enter image description here

If i add the following CSS to the style sheet:

QTabWidget::pane{
}

i get this:

enter image description here

which may look like it fixes the problem, but it does not -

here is the same against a different coloured background:

enter image description here

I then thought that perhaps it was the other lightgray color in use, which would be better, since i want that part to be lightgray anyway, so I changed the colour of the QTabBar background to lightgray.

enter image description here

Still no success.

The colour of the line is neither gray nor lightgray, yet those are the only two colours I use.

How do I get rid of this line?

I would rather a style sheet solution, to keep it out of the program initialisation - as that seems like a messy solution.

Edit: this is using qt designer, and qt 4.6.2. I cannot upgrade the qt version easily.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top