Cocoa: Stop using deprecated -convertBaseToScreen:.

Replaced by -convertRectToScreen:.

Change-Id: I38e2b5918a5ee528d6ce65f676e542e365d610a3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
Erik Verbruggen 2015-04-21 11:28:01 +02:00
parent 1fe2349762
commit 7d84eb7025

View File

@ -753,12 +753,13 @@ QT_WARNING_POP
NSPoint windowPoint = [theEvent locationInWindow];
int windowScreenY = [window frame].origin.y + [window frame].size.height;
int viewScreenY = [window convertBaseToScreen:[self convertPoint:[self frame].origin toView:nil]].y;
NSPoint windowCoord = [self convertPoint:[self frame].origin toView:nil];
int viewScreenY = [window convertRectToScreen:NSMakeRect(windowCoord.x, windowCoord.y, 0, 0)].origin.y;
int titleBarHeight = windowScreenY - viewScreenY;
NSPoint nsViewPoint = [self convertPoint: windowPoint fromView: nil];
QPoint qtWindowPoint = QPoint(nsViewPoint.x, titleBarHeight + nsViewPoint.y);
NSPoint screenPoint = [window convertBaseToScreen:windowPoint];
NSPoint screenPoint = [window convertRectToScreen:NSMakeRect(windowPoint.x, windowPoint.y, 0, 0)].origin;
QPoint qtScreenPoint = QPoint(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y));
ulong timestamp = [theEvent timestamp] * 1000;
@ -1976,7 +1977,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
QPoint qtWindowPoint(windowPoint.x, windowPoint.y);
NSWindow *window = [self window];
NSPoint screenPoint = [window convertBaseToScreen :point];
NSPoint screenPoint = [window convertRectToScreen:NSMakeRect(point.x, point.y, 0, 0)].origin;
QPoint qtScreenPoint = QPoint(screenPoint.x, qt_mac_flipYCoordinate(screenPoint.y));
QWindowSystemInterface::handleMouseEvent(target, mapWindowCoordinates(m_window, target, qtWindowPoint), qtScreenPoint, m_buttons);