From b53994de5f1b641ca2f6c79048339ff34fe14b55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 29 May 2019 16:36:09 +0200 Subject: 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 --- src/plugins/platforms/cocoa/qcocoatheme.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/platforms/cocoa/qcocoatheme.h') 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 + QT_BEGIN_NAMESPACE class QPalette; @@ -82,6 +84,7 @@ public: private: mutable QPalette *m_systemPalette; + QMacNotificationObserver m_systemColorObserver; mutable QHash m_palettes; mutable QHash m_fonts; QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver) *m_appearanceObserver; -- cgit v1.2.3