diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-06-27 14:36:01 -0700 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-07-06 00:58:08 +0000 |
commit | eaa54a8f9884652513c7c3ab489f31ff1e5d712c (patch) | |
tree | cd970abbb665e63f515dae77558607045823bda2 /src/widgets/styles | |
parent | f7aaff01de9d5555e333cedcbbc07236cd653d0a (diff) |
QMacStyle: Properly polish and unpolish QTabBar
Task-number: QTBUG-61092
Change-Id: Id8b6caef264c61936a425757c6d8fac63142d5ec
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 147b2027bf..978810572b 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2262,6 +2262,8 @@ void QMacStyle::polish(QWidget* w) QPalette p = w->palette(); p.setColor(QPalette::WindowText, QColor(17, 17, 17)); w->setPalette(p); + w->setAttribute(Qt::WA_SetPalette, false); + w->setAttribute(Qt::WA_SetFont, false); } } #endif @@ -2304,6 +2306,15 @@ void QMacStyle::unpolish(QWidget* w) } #endif +#ifndef QT_NO_TABBAR + if (QTabBar *tb = qobject_cast<QTabBar*>(w)) { + if (!w->testAttribute(Qt::WA_SetFont)) + w->setFont(qApp->font(w)); + if (!w->testAttribute(Qt::WA_SetPalette)) + w->setPalette(qApp->palette(w)); + } +#endif + if (QRubberBand *rubber = qobject_cast<QRubberBand*>(w)) { rubber->setWindowOpacity(1.0); rubber->setAttribute(Qt::WA_PaintOnScreen, true); |