C++ (Qt)class TabBarButton : public QToolButton{public: TabBarButton( QWidget* p ) : QToolButton( p ) { setStyleSheet( "border: 0px" ); } void paintEvent(QPaintEvent *e) { QPainter p(this); QStyleOptionTabBarBaseV2 opt; opt.init(this); // hardcoded document Mode opt.documentMode = true; int overlap = style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, &opt, this); QRect rect; // hardcoded north position rect.setRect(0, size().height() - overlap, size().width(), overlap); opt.rect = rect; style()->drawPrimitive(QStyle::PE_FrameTabBarBase, &opt, &p, this); QToolButton::paintEvent( e ); }};