diff options
author | Romain Perier <romain.perier@gmail.com> | 2013-05-11 09:28:53 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-16 10:45:04 +0200 |
commit | 94c7002df30d931df13b3bae9d4c46ff1e6f714c (patch) | |
tree | 17cb12d18eb5437ad4fbf16f5e8d2804924ffcaa /src/plugins/platforms/cocoa/qcocoaapplication.mm | |
parent | adaa50e37da1fddada874a289792a1bd95c5aebc (diff) |
Improve Qt-in-namespace implementation in the Cocoa platform plugin
Objective-C++ does not support namespaces. In order to make this work,
we decorate each symbol with suffix using the macro QT_MANGLE_NAMESPACE.
However, with such a technic each public symbol needs to be explicitly exported through
this macro. The use of @compatibility_alias allows to define alias to use it
automatically and transparently.
Task-number: QTBUG-23946
Change-Id: Id521b8160bab126fda40a9d960277b1c04cc8b66
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaapplication.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaapplication.mm | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm index d962ef8f75..c293f4cd52 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplication.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm @@ -87,12 +87,12 @@ QT_USE_NAMESPACE - (void)QT_MANGLE_NAMESPACE(qt_setDockMenu):(NSMenu *)newMenu { - [[QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate] setDockMenu:newMenu]; + [[QCocoaApplicationDelegate sharedDelegate] setDockMenu:newMenu]; } - (QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *)QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader) { - return [[QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) sharedDelegate] menuLoader]; + return [[QCocoaApplicationDelegate sharedDelegate] menuLoader]; } - (int)QT_MANGLE_NAMESPACE(qt_validModesForFontPanel):(NSFontPanel *)fontPanel @@ -155,7 +155,7 @@ static const QByteArray q_macLocalEventType = QByteArrayLiteral("mac_generic_NSE @end -@implementation QT_MANGLE_NAMESPACE(QNSApplication) +@implementation QNSApplication - (void)qt_sendEvent_original:(NSEvent *)event { @@ -189,7 +189,7 @@ QT_BEGIN_NAMESPACE void qt_redirectNSApplicationSendEvent() { - if ([NSApp isMemberOfClass:[QT_MANGLE_NAMESPACE(QNSApplication) class]]) { + if ([NSApp isMemberOfClass:[QNSApplication class]]) { // No need to change implementation since Qt // already controls a subclass of NSApplication return; @@ -202,7 +202,7 @@ void qt_redirectNSApplicationSendEvent() qt_cocoa_change_implementation( [NSApplication class], @selector(sendEvent:), - [QT_MANGLE_NAMESPACE(QNSApplication) class], + [QNSApplication class], @selector(qt_sendEvent_replacement:), @selector(qt_sendEvent_original:)); } |