QSearchField: Replace use of C-style cast

This commit is contained in:
Jonas Kvinge 2022-08-07 05:14:38 +02:00
parent e31dd9f553
commit 1a6fcd5da6
1 changed files with 1 additions and 1 deletions

View File

@ -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<NSSearchField*>([reinterpret_cast<NSText*>(firstResponder) delegate]) == self) {
if ([event type] == NSEventTypeKeyDown && [event modifierFlags] & NSEventModifierFlagCommand) {
QString keyString = toQString([event characters]);