summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-02 01:00:25 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-02 01:00:26 +0200
commitffe9c395dc5a8a3f1dfdd820557d0eadeca24f22 (patch)
treefc823fb5afd857be67fa86af8d019f8d9fa024e6 /src/widgets/styles
parent69beb5f5a04bbb5b7fd64e69d1a655c0f5d956cb (diff)
parent011794130c8e4bb64dbc3c8c9b50849b278cdda3 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp9
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,