summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qwidget.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index d911b48..4cb9380 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -2343,13 +2343,26 @@ void QWidgetPrivate::setStyle_helper(QStyle *newStyle, bool propagate, bool
)
{
Q_Q(QWidget);
- createExtra();
-
QStyle *oldStyle = q->style();
#ifndef QT_NO_STYLE_STYLESHEET
- QStyle *origStyle = extra->style;
+ QStyle *origStyle = 0;
+#endif
+
+#ifdef Q_WS_MAC
+ // the metalhack boolean allows Qt/Mac to do a proper re-polish depending
+ // on how the Qt::WA_MacBrushedMetal attribute is set. It is only ever
+ // set when changing that attribute and passes the widget's CURRENT style.
+ // therefore no need to do a reassignment.
+ if (!metalHack)
#endif
- extra->style = newStyle;
+ {
+ createExtra();
+
+#ifndef QT_NO_STYLE_STYLESHEET
+ origStyle = extra->style;
+#endif
+ extra->style = newStyle;
+ }
// repolish
if (q->windowType() != Qt::Desktop) {