summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-03 01:00:11 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-04-03 01:00:11 +0200
commit682513bed4401fbc5f8fbaf52752565dbdb0fd03 (patch)
tree130a1eb852a1e596a76608193be86cd08bf3c57d /src/widgets/styles
parentb91e6f6f40864d54903d707d7f19a9732188b670 (diff)
parentf99fe9cee9d35e1fabbf45364631f4a7f049ebe3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
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 25d3755e12..f5a3724100 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -4598,8 +4598,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
@@ -4617,6 +4621,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,