Skip to content

Instantly share code, notes, and snippets.

@bjorn
Last active September 12, 2016 12:37
Show Gist options
  • Save bjorn/85c7fe4ce9b7d6a1e385237fe6ea4f4f to your computer and use it in GitHub Desktop.
Save bjorn/85c7fe4ce9b7d6a1e385237fe6ea4f4f to your computer and use it in GitHub Desktop.
Drawing tab bar base behind some other control
QStylePainter p(this);
QStyleOptionTab tabOverlap;
int overlap = style()->pixelMetric(QStyle::PM_TabBarBaseOverlap, &tabOverlap);
QStyleOptionTabBarBase tabBarStyleOption;
tabBarStyleOption.rect.setRect(0, height() - overlap, width(), overlap);
tabBarStyleOption.tabBarRect = rect();
p.drawPrimitive(QStyle::PE_FrameTabBarBase, tabBarStyleOption);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment