diff options
author | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-10-20 13:38:22 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@theqtcompany.com> | 2015-10-23 07:51:34 +0000 |
commit | 07475c662eb73c833da2d461b8ef2702ca1e2cfb (patch) | |
tree | b66dcf892dd2e4d012db19652bbe9191d426b788 | |
parent | 8515aa18716779985a5955292524fd683528c576 (diff) |
OSX: replace use of deprecated API.
dragImage:at:offset:event:pasteboard:source:slideBack: on NSView is
deprecated since 10.7. Use the one on NSWindow instead.
Change-Id: Ia1c2ea367ae2ca5194b52ea57ab261461bf8b529
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoadrag.mm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index 4466d28128..8aa7a6b583 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -127,16 +127,17 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o) dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest); NSPoint event_location = [m_lastEvent locationInWindow]; - NSPoint local_point = [m_lastView convertPoint:event_location fromView:nil]; - local_point.x -= hotSpot.x(); + NSWindow *theWindow = [m_lastEvent window]; + Q_ASSERT(theWindow != nil); + event_location.x -= hotSpot.x(); CGFloat flippedY = pm.height() - hotSpot.y(); - local_point.y += flippedY; - NSSize mouseOffset = NSMakeSize(0.0, 0.0); + event_location.y -= flippedY; + NSSize mouseOffset_unused = NSMakeSize(0.0, 0.0); NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - [m_lastView dragImage:nsimage - at:local_point - offset:mouseOffset + [theWindow dragImage:nsimage + at:event_location + offset:mouseOffset_unused event:m_lastEvent pasteboard:pboard source:m_lastView |