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>
This commit is contained in:
parent
8515aa1871
commit
07475c662e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user