Qt: hiding border for selected tab in QTabBar
Asked Answered
D

1

7

QTabBar has a 1px border that separates tabs from their content.

QTabWidget::pane { border:1px solid #C4C4C3; }

I want the border to disappear under selected tab, like it's done in all browsers and most of applications using tabs.

However, setting styles for QTabBar::tab doesn't help:

QTabBar::tab:selected { border-bottom-color:white; }

enter image description here

So how can I achieve this?

Dodger answered 6/4, 2012 at 16:55 Comment(0)
P
14

That line is controlled by the top border of QTabWidget::pane. For example:

QTabWidget::pane { border: 1px solid #C4C4C3; top: -1px; }

would move the line behind/under the tabs (somehow using top alone seems to remove the border completely).

Pietism answered 6/4, 2012 at 17:53 Comment(1)
Great! Exactly what I needed. Didn't think about that top:-1px.Dodger

© 2022 - 2024 — McMap. All rights reserved.