尝试像这样:
tabwidget.setStyleSheet("QTabWidget::pane {
margin: 0px,1px,1px,1px;
border: 2px solid #020202;
border-radius: 7px;
padding: 1px;
background-color: #E6E6E3;
}");
QTabWidget
的“pane”边距有关。QTabWidget::pane {
border: 0 solid white;
margin: -13px -9px -13px -9px;
}