macOS: Simplify mangling of QNSPanelDelegate protocol
Change-Id: If29bc36ecab2feb4ce3372153d0d1566cdffc719 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
parent
3f6bc9a983
commit
841542225b
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
QT_USE_NAMESPACE
|
QT_USE_NAMESPACE
|
||||||
|
|
||||||
@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject<NSWindowDelegate, QT_MANGLE_NAMESPACE(QNSPanelDelegate)>
|
@interface QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) : NSObject<NSWindowDelegate, QNSPanelDelegate>
|
||||||
{
|
{
|
||||||
@public
|
@public
|
||||||
NSColorPanel *mColorPanel;
|
NSColorPanel *mColorPanel;
|
||||||
|
@ -75,7 +75,7 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
|
|||||||
|
|
||||||
@class QT_MANGLE_NAMESPACE(QNSFontPanelDelegate);
|
@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
|
@public
|
||||||
NSFontPanel *mFontPanel;
|
NSFontPanel *mFontPanel;
|
||||||
|
@ -161,7 +161,10 @@ T qt_mac_resolveOption(const T &fallback, QWindow *window, const QByteArray &pro
|
|||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
@protocol QT_MANGLE_NAMESPACE(QNSPanelDelegate)
|
// @compatibility_alias doesn't work with protocols
|
||||||
|
#define QNSPanelDelegate QT_MANGLE_NAMESPACE(QNSPanelDelegate)
|
||||||
|
|
||||||
|
@protocol QNSPanelDelegate
|
||||||
@required
|
@required
|
||||||
- (void)onOkClicked;
|
- (void)onOkClicked;
|
||||||
- (void)onCancelClicked;
|
- (void)onCancelClicked;
|
||||||
@ -179,7 +182,7 @@ QT_END_NAMESPACE
|
|||||||
@property (nonatomic, readonly) NSView *panelContents; // ARC: unretained, make it weak
|
@property (nonatomic, readonly) NSView *panelContents; // ARC: unretained, make it weak
|
||||||
@property (nonatomic, assign) NSEdgeInsets panelContentsMargins;
|
@property (nonatomic, assign) NSEdgeInsets panelContentsMargins;
|
||||||
|
|
||||||
- (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate;
|
- (instancetype)initWithPanelDelegate:(id<QNSPanelDelegate>)panelDelegate;
|
||||||
- (void)dealloc;
|
- (void)dealloc;
|
||||||
|
|
||||||
- (NSButton *)createButtonWithTitle:(const char *)title;
|
- (NSButton *)createButtonWithTitle:(const char *)title;
|
||||||
|
@ -308,7 +308,7 @@ QT_END_NAMESPACE
|
|||||||
@synthesize panelContents = _panelContents;
|
@synthesize panelContents = _panelContents;
|
||||||
@synthesize panelContentsMargins = _panelContentsMargins;
|
@synthesize panelContentsMargins = _panelContentsMargins;
|
||||||
|
|
||||||
- (instancetype)initWithPanelDelegate:(id<QT_MANGLE_NAMESPACE(QNSPanelDelegate)>)panelDelegate
|
- (instancetype)initWithPanelDelegate:(id<QNSPanelDelegate>)panelDelegate
|
||||||
{
|
{
|
||||||
if ((self = [super initWithFrame:NSZeroRect])) {
|
if ((self = [super initWithFrame:NSZeroRect])) {
|
||||||
// create OK and Cancel buttons and add these as subviews
|
// create OK and Cancel buttons and add these as subviews
|
||||||
|
Loading…
x
Reference in New Issue
Block a user