How can I style QTabWidget like is in the image below.
The problem is: if I set style sheet
QTabWidget:pane {
border: 1px solid gray;
}
then it looks like this:
How can I style QTabWidget like is in the image below.
The problem is: if I set style sheet
QTabWidget:pane {
border: 1px solid gray;
}
then it looks like this:
Reposting my comment. Here is the solution.
Ok. Thank you for giving me right direction. Here is an aproximate style sheet. The key moment is QTabWidget::pane { top: -1px; }. It moves pane up (and it's top border) so it doesn't disturb, and QTabBar::tab:selected {margin-bottom: -1px; } as well - it hides appearing tabbar bottom and pane top differences
QTabWidget::pane {
border: 1px solid lightgray;
top:-1px;
background: rgb(245, 245, 245);;
}
QTabBar::tab {
background: rgb(230, 230, 230);
border: 1px solid lightgray;
padding: 15px;
}
QTabBar::tab:selected {
background: rgb(245, 245, 245);
margin-bottom: -1px;
}
Styling the tabwidget:
QTabWidget::tab-bar {
border: 1px solid gray;
}
Styling tab:
QTabBar::tab {
background: gray;
color: white;
padding: 10px;
}
QTabBar::tab:selected {
background: lightgray;
}
Styling Panel:
QTabWidget::pane {
border: none;
}
Example:
© 2022 - 2024 — McMap. All rights reserved.
QTabBar
. – Kernan