summaryrefslogtreecommitdiffstats
path: root/src/widgets
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
parentb91e6f6f40864d54903d707d7f19a9732188b670 (diff)
parentf99fe9cee9d35e1fabbf45364631f4a7f049ebe3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/itemviews/qlistwidget.h3
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qlistwidget.h b/src/widgets/itemviews/qlistwidget.h
index c093d13e6d..c102b144df 100644
--- a/src/widgets/itemviews/qlistwidget.h
+++ b/src/widgets/itemviews/qlistwidget.h
@@ -118,10 +118,11 @@ public:
QT_DEPRECATED_X ("Use QListWidgetItem::background() instead")
inline QColor backgroundColor() const
{ return qvariant_cast<QColor>(data(Qt::BackgroundRole)); }
+#endif
+ // no QT_DEPRECATED_SINCE because it is a virtual function
QT_DEPRECATED_X ("Use QListWidgetItem::setBackground() instead")
virtual void setBackgroundColor(const QColor &color)
{ setData(Qt::BackgroundRole, color); }
-#endif
inline QBrush background() const
{ return qvariant_cast<QBrush>(data(Qt::BackgroundRole)); }
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,