diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 01:00:25 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-04-02 01:00:26 +0200 |
commit | ffe9c395dc5a8a3f1dfdd820557d0eadeca24f22 (patch) | |
tree | fc823fb5afd857be67fa86af8d019f8d9fa024e6 /src/widgets | |
parent | 69beb5f5a04bbb5b7fd64e69d1a655c0f5d956cb (diff) | |
parent | 011794130c8e4bb64dbc3c8c9b50849b278cdda3 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ia5d893e57deb78bc32e2053a5a79543ff847fe32
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index c104ac2498..9a3d938d25 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -4593,8 +4593,12 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op break; #if QT_CONFIG(tabbar) case PE_IndicatorTabClose: - if (w) + if (w) { + // QMacStyle needs a real widget, not its parent - to implement + // 'document mode' properly, drawing nothing if a tab is not hovered. + baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant::fromValue((void *)w)); w = w->parentWidget(); //match on the QTabBar instead of the CloseButton + } pseudoElement = PseudoElement_TabBarTabCloseButton; #endif @@ -4612,6 +4616,9 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op } else { baseStyle()->drawPrimitive(pe, opt, p, w); } + + if (baseStyle()->property("_q_styleSheetRealCloseButton").toBool()) + baseStyle()->setProperty("_q_styleSheetRealCloseButton", QVariant(QVariant::Invalid)); } QPixmap QStyleSheetStyle::generatedIconPixmap(QIcon::Mode iconMode, const QPixmap& pixmap, |