Changeset 846 for trunk/src/gui/kernel/qcocoaapplication_mac.mm
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qcocoaapplication_mac.mm
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 #include <private/qt_cocoa_helpers_mac_p.h> 81 81 82 QT_USE_NAMESPACE 83 82 84 @implementation NSApplication (QT_MANGLE_NAMESPACE(QApplicationIntegration)) 83 85 … … 108 110 } 109 111 112 - (void)qt_sendPostedMessage:(NSEvent *)event 113 { 114 // WARNING: data1 and data2 is truncated to from 64-bit to 32-bit on OS 10.5! 115 // That is why we need to split the address in two parts: 116 quint64 lower = [event data1]; 117 quint64 upper = [event data2]; 118 QCocoaPostMessageArgs *args = reinterpret_cast<QCocoaPostMessageArgs *>(lower | (upper << 32)); 119 [args->target performSelector:args->selector]; 120 delete args; 121 } 122 123 - (BOOL)qt_sendEvent:(NSEvent *)event 124 { 125 if ([event type] == NSApplicationDefined) { 126 switch ([event subtype]) { 127 case QtCocoaEventSubTypePostMessage: 128 [NSApp qt_sendPostedMessage:event]; 129 return true; 130 default: 131 break; 132 } 133 } 134 return false; 135 } 136 110 137 @end 138 139 @implementation QNSApplication 140 141 // WARNING: If Qt did not create NSApplication (this can e.g. 142 // happend if Qt is used as a plugin from a 3rd-party cocoa 143 // application), QNSApplication::sendEvent will never be called. 144 // SO DO NOT RELY ON THIS FUNCTION BEING AVAILABLE. 145 // Plugin developers that _do_ control the NSApplication sub-class 146 // implementation of the 3rd-party application can call qt_sendEvent 147 // from the sub-class event handler (like we do here) to work around 148 // any issues. 149 - (void)sendEvent:(NSEvent *)event 150 { 151 if (![self qt_sendEvent:event]) 152 [super sendEvent:event]; 153 } 154 155 @end 156 111 157 #endif
Note:
See TracChangeset
for help on using the changeset viewer.