diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qnswindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qnswindow.mm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index cb13b7d184..c959fdd917 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -38,7 +38,6 @@ ****************************************************************************/ #include "qnswindow.h" -#include "qnswindowdelegate.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" #include "qcocoaeventdispatcher.h" @@ -46,7 +45,7 @@ #include <qpa/qwindowsysteminterface.h> #include <qoperatingsystemversion.h> -Q_LOGGING_CATEGORY(lcCocoaEvents, "qt.qpa.cocoa.events"); +Q_LOGGING_CATEGORY(lcQpaEvents, "qt.qpa.events"); static bool isMouseEvent(NSEvent *ev) { @@ -72,7 +71,7 @@ static bool isMouseEvent(NSEvent *ev) [center addObserverForName:NSWindowDidEnterFullScreenNotification object:nil queue:nil usingBlock:^(NSNotification *notification) { objc_setAssociatedObject(notification.object, @selector(qt_fullScreen), - [NSNumber numberWithBool:YES], OBJC_ASSOCIATION_RETAIN); + @(YES), OBJC_ASSOCIATION_RETAIN); } ]; [center addObserverForName:NSWindowDidExitFullScreenNotification object:nil queue:nil @@ -202,7 +201,7 @@ static bool isMouseEvent(NSEvent *ev) - (void)sendEvent:(NSEvent*)theEvent { - qCDebug(lcCocoaEvents) << "Sending" << theEvent << "to" << self; + qCDebug(lcQpaEvents) << "Sending" << theEvent << "to" << self; // We might get events for a NSWindow after the corresponding platform // window has been deleted, as the NSWindow can outlive the QCocoaWindow @@ -239,7 +238,7 @@ static bool isMouseEvent(NSEvent *ev) - (void)closeAndRelease { - qCDebug(lcQpaCocoaWindow) << "closeAndRelease" << self; + qCDebug(lcQpaWindow) << "closeAndRelease" << self; [self.delegate release]; self.delegate = nil; @@ -252,7 +251,7 @@ static bool isMouseEvent(NSEvent *ev) #pragma clang diagnostic ignored "-Wobjc-missing-super-calls" - (void)dealloc { - qCDebug(lcQpaCocoaWindow) << "dealloc" << self; + qCDebug(lcQpaWindow) << "dealloc" << self; qt_objcDynamicSuper(); } #pragma clang diagnostic pop @@ -267,14 +266,14 @@ static bool isMouseEvent(NSEvent *ev) if (__builtin_available(macOS 10.12, *)) { // Unfortunately there's no NSWindowListOrderedBackToFront, // so we have to manually reverse the order using an array. - NSMutableArray *windows = [[[NSMutableArray alloc] init] autorelease]; + NSMutableArray<NSWindow *> *windows = [NSMutableArray<NSWindow *> new]; [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack usingBlock:^(NSWindow *window, BOOL *) { // For some reason AppKit will give us nil-windows, skip those if (!window) return; - [(NSMutableArray*)windows addObject:window]; + [windows addObject:window]; } ]; |