diff options
author | Jake Petroules <jake.petroules@qt.io> | 2018-02-01 10:32:07 -0800 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-02-20 10:02:12 +0000 |
commit | ba871065e0f40e9197fa4ee0ffe76530bb6fca11 (patch) | |
tree | d4361d26260ef3bd96d9f89450893b7c9e99fbeb /src/plugins/platforms/cocoa/qcocoahelpers.h | |
parent | 34017a8c5aaca2723fb62e79ea177b5579040ad3 (diff) |
Clean up our Objective-C usage
- Move ivars into @implementation
- Use instancetype where applicable
- Use dot notation for property access
- Use subscript operator for dictionaries and arrays
- Format selectors consistently
- Use proper style for init methods
- Use generics instead of void pointers where possible
- Use "range for" loops instead of indexing
- Replace or replace IBAction/IBOutlet with void
Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.h')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index 84632c1487..7fd8715277 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -70,11 +70,8 @@ class QPixmap; class QString; // Conversion functions -QStringList qt_mac_NSArrayToQStringList(void *nsarray); -void *qt_mac_QStringListToNSMutableArrayVoid(const QStringList &list); - -inline NSMutableArray *qt_mac_QStringListToNSMutableArray(const QStringList &qstrlist) -{ return reinterpret_cast<NSMutableArray *>(qt_mac_QStringListToNSMutableArrayVoid(qstrlist)); } +QStringList qt_mac_NSArrayToQStringList(NSArray<NSString *> *nsarray); +NSMutableArray<NSString *> *qt_mac_QStringListToNSMutableArray(const QStringList &list); NSDragOperation qt_mac_mapDropAction(Qt::DropAction action); NSDragOperation qt_mac_mapDropActions(Qt::DropActions actions); @@ -170,12 +167,7 @@ QT_END_NAMESPACE - (void)onCancelClicked; @end -@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView { - NSButton *_okButton; - NSButton *_cancelButton; - NSView *_panelContents; - NSEdgeInsets _panelContentsMargins; -} +@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView @property (nonatomic, readonly) NSButton *okButton; @property (nonatomic, readonly) NSButton *cancelButton; @@ -187,6 +179,7 @@ QT_END_NAMESPACE - (NSButton *)createButtonWithTitle:(const char *)title; - (void)layout; + @end QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSPanelContentsWrapper); |