macOS: Simplify mangling of QNSPanelDelegate protocol

Change-Id: If29bc36ecab2feb4ce3372153d0d1566cdffc719
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-01-09 18:19:26 +01:00 committed by Jani Heikkinen
parent 3f6bc9a983
commit 841542225b
4 changed files with 8 additions and 5 deletions

View File

@ -49,7 +49,7 @@
QT_USE_NAMESPACE
@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject<NSWindowDelegate, QT_MANGLE_NAMESPACE(QNSPanelDelegate)>
@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject<NSWindowDelegate, QNSPanelDelegate>
{
@public
NSColorPanel *mColorPanel;

View File

@ -75,7 +75,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
@class QT_MANGLE_NAMESPACE(QNSFontPanelDelegate);
@interface QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) : NSObject<NSWindowDelegate, QT_MANGLE_NAMESPACE(QNSPanelDelegate)>
@interface QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) : NSObject<NSWindowDelegate, QNSPanelDelegate>
{
@public
NSFontPanel *mFontPanel;

View File

@ -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<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate;
- (instancetype)initWithPanelDelegate:(id<QNSPanelDelegate>)panelDelegate;
- (void)dealloc;
- (NSButton *)createButtonWithTitle:(const char *)title;

View File

@ -308,7 +308,7 @@ QT_END_NAMESPACE
@synthesize panelContents = _panelContents;
@synthesize panelContentsMargins = _panelContentsMargins;
- (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate
- (instancetype)initWithPanelDelegate:(id<QNSPanelDelegate>)panelDelegate
{
if ((self = [super initWithFrame:NSZeroRect])) {
// create OK and Cancel buttons and add these as subviews