diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacursor.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacursor.mm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacursor.mm b/src/plugins/platforms/cocoa/qcocoacursor.mm index 8c98dc69f7..87a57c78c8 100644 --- a/src/plugins/platforms/cocoa/qcocoacursor.mm +++ b/src/plugins/platforms/cocoa/qcocoacursor.mm @@ -80,15 +80,15 @@ void QCocoaCursor::setPos(const QPoint &position) pos.x = position.x(); pos.y = position.y(); - CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, kCGMouseButtonLeft); + CGEventRef e = CGEventCreateMouseEvent(nullptr, kCGEventMouseMoved, pos, kCGMouseButtonLeft); CGEventPost(kCGHIDEventTap, e); CFRelease(e); } NSCursor *QCocoaCursor::convertCursor(QCursor *cursor) { - if (cursor == nullptr) - return 0; + if (!cursor) + return nil; const Qt::CursorShape newShape = cursor->shape(); NSCursor *cocoaCursor; @@ -138,11 +138,11 @@ NSCursor *QCocoaCursor::convertCursor(QCursor *cursor) cocoaCursor = m_cursors.value(newShape); if (cocoaCursor && cursor->shape() == Qt::BitmapCursor) { [cocoaCursor release]; - cocoaCursor = 0; + cocoaCursor = nil; } - if (cocoaCursor == 0) { + if (!cocoaCursor) { cocoaCursor = createCursorData(cursor); - if (cocoaCursor == 0) + if (!cocoaCursor) return [NSCursor arrowCursor]; m_cursors.insert(newShape, cocoaCursor); @@ -211,8 +211,8 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor) 0x07, 0xf0, 0x0f, 0xf8, 0x0f, 0xf8, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0 }; #endif - const uchar *cursorData = 0; - const uchar *cursorMaskData = 0; + const uchar *cursorData = nullptr; + const uchar *cursorMaskData = nullptr; QPoint hotspot = cursor->hotSpot(); switch (cursor->shape()) { @@ -269,7 +269,7 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor) #endif default: qWarning("Qt: QCursor::update: Invalid cursor shape %d", cursor->shape()); - return 0; + return nil; } // Create an NSCursor from image data if this a self-provided cursor. @@ -279,7 +279,7 @@ NSCursor *QCocoaCursor::createCursorData(QCursor *cursor) return (createCursorFromBitmap(&bitmap, &mask, hotspot)); } - return 0; // should not happen, all cases covered above + return nil; // should not happen, all cases covered above } NSCursor *QCocoaCursor::createCursorFromBitmap(const QBitmap *bitmap, const QBitmap *mask, const QPoint hotspot) |