diff --git a/src/widgets/qsearchfield_mac.mm b/src/widgets/qsearchfield_mac.mm index d7828ea9b..0629f862d 100644 --- a/src/widgets/qsearchfield_mac.mm +++ b/src/widgets/qsearchfield_mac.mm @@ -127,7 +127,7 @@ public: // First, check if we have the focus. // If no, it probably means this event isn't for us. NSResponder *firstResponder = [[NSApp keyWindow] firstResponder]; - if ([firstResponder isKindOfClass:[NSText class]] && (NSSearchField*)([(NSText*)firstResponder delegate]) == self) { + if ([firstResponder isKindOfClass:[NSText class]] && reinterpret_cast([reinterpret_cast(firstResponder) delegate]) == self) { if ([event type] == NSEventTypeKeyDown && [event modifierFlags] & NSEventModifierFlagCommand) { QString keyString = toQString([event characters]);