diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoatheme.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoatheme.mm | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 93f0400916..0f1bfea7b5 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -75,28 +75,26 @@ #endif #endif -#include <Carbon/Carbon.h> +#include <CoreServices/CoreServices.h> -@interface QT_MANGLE_NAMESPACE(QCocoaThemeNotificationReceiver) : NSObject { -QCocoaTheme *mPrivate; -} -- (id)initWithPrivate:(QCocoaTheme *)priv; -- (void)systemColorsDidChange:(NSNotification *)notification; +@interface QT_MANGLE_NAMESPACE(QCocoaThemeNotificationReceiver) : NSObject @end QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaThemeNotificationReceiver); -@implementation QCocoaThemeNotificationReceiver -- (id)initWithPrivate:(QCocoaTheme *)priv +@implementation QCocoaThemeNotificationReceiver { + QCocoaTheme *mPrivate; +} + +- (instancetype)initWithPrivate:(QCocoaTheme *)priv { - self = [super init]; - mPrivate = priv; + if ((self = [self init])) + mPrivate = priv; return self; } -- (void)systemColorsDidChange:(NSNotification *)notification +- (void)systemColorsDidChange:(NSNotification *)__unused notification { - Q_UNUSED(notification); mPrivate->reset(); QWindowSystemInterface::handleThemeChange(nullptr); } @@ -107,7 +105,7 @@ QT_BEGIN_NAMESPACE const char *QCocoaTheme::name = "cocoa"; QCocoaTheme::QCocoaTheme() - :m_systemPalette(0) + : m_systemPalette(nullptr) { m_notificationReceiver = [[QT_MANGLE_NAMESPACE(QCocoaThemeNotificationReceiver) alloc] initWithPrivate:this]; [[NSNotificationCenter defaultCenter] addObserver:m_notificationReceiver @@ -147,7 +145,7 @@ bool QCocoaTheme::usePlatformNativeDialog(DialogType dialogType) const return false; } -QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialogType) const +QPlatformDialogHelper *QCocoaTheme::createPlatformDialogHelper(DialogType dialogType) const { switch (dialogType) { #if defined(QT_WIDGETS_LIB) && QT_CONFIG(filedialog) @@ -163,7 +161,7 @@ QPlatformDialogHelper * QCocoaTheme::createPlatformDialogHelper(DialogType dialo return new QCocoaFontDialogHelper(); #endif default: - return 0; + return nullptr; } } @@ -183,9 +181,9 @@ const QPalette *QCocoaTheme::palette(Palette type) const } else { if (m_palettes.isEmpty()) m_palettes = qt_mac_createRolePalettes(); - return m_palettes.value(type, 0); + return m_palettes.value(type, nullptr); } - return 0; + return nullptr; } QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts() @@ -199,7 +197,7 @@ const QFont *QCocoaTheme::font(Font type) const if (m_fonts.isEmpty()) { m_fonts = qt_mac_createRoleFonts(); } - return m_fonts.value(type, 0); + return m_fonts.value(type, nullptr); } //! \internal |