I'm trying to customize a QTabWidget as below. But I don't know how to show the line marked by red color as below in qss.
Asked
Active
Viewed 723 times
5
-
As background image – Dmitry Sazonov Dec 15 '17 at 11:01
1 Answers
3
You have to style two different subcontrols of QTabWidget: pane and tab-bar.
Give pane a top border and a negative top:
QTabWidget::pane{
border-top: 1px solid red;
margin-top: -1px;
}
Now the selected tab of the tab-bar:
QTabBar::tab:selected{
border-top: 1px solid red;
border-left: 1px solid red;
border-right: 1px solid red;
background-color: rgb(240, 240, 240);
}
Please note that the selected tab can not have transparent background, otherwise the pane top border will show up behind it (here I provided a light gray background, just as an example).

p-a-o-l-o
- 9,807
- 2
- 22
- 35