1

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.

will
  • 10,260
  • 6
  • 46
  • 69
  • I can't seem to replicate your issue. Can you post a full code with the problem? – Avaris Jan 17 '13 at 01:22
  • @Avaris that might not be so easy, the designer spits out a lot of stuff. And besides, i can get the issue in just the designer alone. Make a new `MainWindow` app, add a `QTabWidget` in a `QVerticalLayout` and then add the css to the `QMainWindow`. It will be harder to see with the frame on. – will Jan 17 '13 at 10:02
  • I still can't replicate it. [Here is](http://i.imgur.com/r4ktL.png) what i get. I put the `QLabel` above in order to not miss anything on the top. – Avaris Jan 17 '13 at 10:53
  • What the?! What Qt version are you using? Could the fact that i'm on Scientific Linux have an effect? – will Jan 17 '13 at 19:43
  • Maybe the version difference has an effect. I'm using 4.8.0. – Avaris Jan 17 '13 at 21:25
  • I'll try it out on another computer later then i guess – will Jan 17 '13 at 22:49

0 Answers0