summaryrefslogtreecommitdiffstats
path: root/src/plugins/styles/mac
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-06-26 12:56:12 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-07-20 12:03:29 +0200
commit857e4881c66b5db5c8cab654d33fafe5db55396c (patch)
treee61e7d5b17f1da76d9e1fb985796ca967455d486 /src/plugins/styles/mac
parenta96a64be2dc3110d140e43d2cf85454d9fc998b8 (diff)
macOS: Properly unpolish font and palette
Explicitly setting the application font and palette will actually persist the current state of the application font and palette to the widget, and it will stop reacting to system style changes. Change-Id: Ib856fe86cd3edb618b7ee5819d6c6c892c61fd1d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/styles/mac')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index ce08725684..e10aa33623 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -2139,10 +2139,9 @@ void QMacStyle::unpolish(QWidget* w)
#if QT_CONFIG(menu)
qobject_cast<QMenu*>(w) &&
#endif
- !w->testAttribute(Qt::WA_SetPalette)) {
- QPalette pal = qApp->palette(w);
- w->setPalette(pal);
- w->setAttribute(Qt::WA_SetPalette, false);
+ !w->testAttribute(Qt::WA_SetPalette))
+ {
+ w->setPalette(QPalette());
w->setWindowOpacity(1.0);
}
@@ -2158,9 +2157,9 @@ void QMacStyle::unpolish(QWidget* w)
#if QT_CONFIG(tabbar)
if (qobject_cast<QTabBar*>(w)) {
if (!w->testAttribute(Qt::WA_SetFont))
- w->setFont(qApp->font(w));
+ w->setFont(QFont());
if (!w->testAttribute(Qt::WA_SetPalette))
- w->setPalette(qApp->palette(w));
+ w->setPalette(QPalette());
}
#endif