summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoatheme.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-05-29 16:36:09 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-05-29 17:11:40 +0200
commitb53994de5f1b641ca2f6c79048339ff34fe14b55 (patch)
tree4c6c1fe9cc8ff91a8ac563d06cfbb1edcd5218e7 /src/plugins/platforms/cocoa/qcocoatheme.h
parent15d73a9f479e88af85944119e79d88ed26d4f346 (diff)
macOS: Use QMacNotificationObserver over manual notification handling
This also fixes a bug where we were implicitly capturing this inside the block, which meant that we would crash if the theme was recreated. The capture is now tied to the lifetime of QCocoaTheme. Change-Id: I37df8e6c0b33bf41e76d66be3cf29576041a7546 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoatheme.h')
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index c42fa7d2e8..63227ed6c1 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -45,6 +45,8 @@
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver));
+#include <QtCore/private/qcore_mac_p.h>
+
QT_BEGIN_NAMESPACE
class QPalette;
@@ -82,6 +84,7 @@ public:
private:
mutable QPalette *m_systemPalette;
+ QMacNotificationObserver m_systemColorObserver;
mutable QHash<QPlatformTheme::Palette, QPalette*> m_palettes;
mutable QHash<QPlatformTheme::Font, QFont*> m_fonts;
QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver) *m_appearanceObserver;