From 841542225bf5d3f1c4b3fd4c24adf4201f3a131f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 9 Jan 2018 18:19:26 +0100 Subject: macOS: Simplify mangling of QNSPanelDelegate protocol Change-Id: If29bc36ecab2feb4ce3372153d0d1566cdffc719 Reviewed-by: Jake Petroules --- src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 2 +- src/plugins/platforms/cocoa/qcocoahelpers.h | 7 +++++-- src/plugins/platforms/cocoa/qcocoahelpers.mm | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 5d331c0e96..aa6124507d 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -49,7 +49,7 @@ QT_USE_NAMESPACE -@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject +@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject { @public NSColorPanel *mColorPanel; diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index dbd7e90dba..9a96895d07 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -75,7 +75,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont) @class QT_MANGLE_NAMESPACE(QNSFontPanelDelegate); -@interface QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) : NSObject +@interface QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) : NSObject { @public NSFontPanel *mFontPanel; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index 4478895538..0cf9cc0aff 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -161,7 +161,10 @@ T qt_mac_resolveOption(const T &fallback, QWindow *window, const QByteArray &pro QT_END_NAMESPACE -@protocol QT_MANGLE_NAMESPACE(QNSPanelDelegate) +// @compatibility_alias doesn't work with protocols +#define QNSPanelDelegate QT_MANGLE_NAMESPACE(QNSPanelDelegate) + +@protocol QNSPanelDelegate @required - (void)onOkClicked; - (void)onCancelClicked; @@ -179,7 +182,7 @@ QT_END_NAMESPACE @property (nonatomic, readonly) NSView *panelContents; // ARC: unretained, make it weak @property (nonatomic, assign) NSEdgeInsets panelContentsMargins; -- (instancetype)initWithPanelDelegate:(id)panelDelegate; +- (instancetype)initWithPanelDelegate:(id)panelDelegate; - (void)dealloc; - (NSButton *)createButtonWithTitle:(const char *)title; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 5d0f13c5a9..c3efe158c7 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -308,7 +308,7 @@ QT_END_NAMESPACE @synthesize panelContents = _panelContents; @synthesize panelContentsMargins = _panelContentsMargins; -- (instancetype)initWithPanelDelegate:(id)panelDelegate +- (instancetype)initWithPanelDelegate:(id)panelDelegate { if ((self = [super initWithFrame:NSZeroRect])) { // create OK and Cancel buttons and add these as subviews -- cgit v1.2.3