src/gui/widgets/qcocoamenu_mac.mm
changeset 37 758a864f9613
parent 30 5dc02b23752f
--- a/src/gui/widgets/qcocoamenu_mac.mm	Fri Sep 17 08:34:18 2010 +0300
+++ b/src/gui/widgets/qcocoamenu_mac.mm	Mon Oct 04 01:19:32 2010 +0300
@@ -188,6 +188,18 @@
     return NO;
 }
 
+- (NSInteger)indexOfItemWithTarget:(id)anObject andAction:(SEL)actionSelector
+{
+     NSInteger index = [super indexOfItemWithTarget:anObject andAction:actionSelector];
+     static SEL selForOFCP = NSSelectorFromString(@"orderFrontCharacterPalette:");
+     if (index == -1 && selForOFCP == actionSelector) {
+         // Check if the 'orderFrontCharacterPalette' SEL exists for QCocoaMenuLoader object
+         QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *loader = [NSApp QT_MANGLE_NAMESPACE(qt_qcocoamenuLoader)];
+         return [super indexOfItemWithTarget:loader andAction:actionSelector];
+     }
+     return index;
+}
+
 @end
 
 QT_BEGIN_NAMESPACE