diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-10-05 13:22:42 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-10-15 20:09:28 +0200 |
commit | 027d45cb57a7cf20b2714509250a87f1e8842b9c (patch) | |
tree | cb76992b6640dcb31df618a4349bf9f2c9759bd6 /src/plugins/platforms/cocoa/qnsview_mouse.mm | |
parent | 05a829f923a88e69b2ceaa372820a2dcb8c083cd (diff) |
macOS: Simplify Objective-C namespacing
We only need to use the QT_MANGLE_NAMESPACE macro when declaring the
interface of the class. As long as we couple that with an alias
declaration using QT_NAMESPACE_ALIAS_OBJC_CLASS, any further uses
of the class name can be un-namespaced, including declaring
categories on the class.
The only snag with QT_NAMESPACE_ALIAS_OBJC_CLASS is that it can
only be used once per class and translation unit, so forward
declarations get hairy, but we can avoid that by just including
the headers instead.
Change-Id: I333bcd18fe1e18d81fbd560b0941c98b1c32460e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview_mouse.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview_mouse.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index 30613eca32..9e2761f850 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -55,7 +55,7 @@ interact with the responder chain by e.g. calling super if Qt does not accept the mouse event */ -@implementation QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) { +@implementation QNSViewMouseMoveHelper { QNSView *view; } @@ -89,7 +89,7 @@ @end -@implementation QT_MANGLE_NAMESPACE(QNSView) (MouseAPI) +@implementation QNSView (MouseAPI) - (void)resetMouseButtons { @@ -178,7 +178,7 @@ } @end -@implementation QT_MANGLE_NAMESPACE(QNSView) (Mouse) +@implementation QNSView (Mouse) - (void)initMouse { @@ -193,7 +193,7 @@ m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, m_platformWindow->window(), "_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB"); - m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self]; + m_mouseMoveHelper = [[QNSViewMouseMoveHelper alloc] initWithView:self]; NSUInteger trackingOptions = NSTrackingActiveInActiveApp | NSTrackingMouseEnteredAndExited | NSTrackingCursorUpdate; |