From ebee64645a672e82ffca3b48dbc007cd2f2a52f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 13 May 2016 13:30:46 +0200 Subject: darwin: Add Foundation conversion functions for QRect/QRectF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fromCGRect function was left out for QRect, as the foundation type is using CGFloats internally. Clients should use an explicit QRectF::toRect() when potentially throwing away precision. Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf Reviewed-by: Jake Petroules Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/cocoa/qnsview.mm') diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 19688efdc7..ffc3dec814 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -322,9 +322,9 @@ static bool _q_dontOverrideCtrlLMB = false; if (m_platformWindow->m_isNSWindowChild) { return; #if 0 - //geometry = qt_mac_toQRect([self frame]); + //geometry = QRectF::fromCGRect([self frame]).toRect(); qDebug() << "nsview updateGeometry" << m_platformWindow->window(); - QRect screenRect = qt_mac_toQRect([m_platformWindow->m_nsWindow convertRectToScreen:[self frame]]); + QRect screenRect = QRectF::fromCGRect([m_platformWindow->m_nsWindow convertRectToScreen:[self frame]]).toRect(); qDebug() << "screenRect" << screenRect; screenRect.moveTop(qt_mac_flipYCoordinate(screenRect.y() + screenRect.height())); @@ -339,10 +339,10 @@ static bool _q_dontOverrideCtrlLMB = false; geometry = QRect(windowRect.origin.x, qt_mac_flipYCoordinate(windowRect.origin.y + rect.size.height), rect.size.width, rect.size.height); } else if (m_platformWindow->m_contentViewIsToBeEmbedded) { // embedded child window, use the frame rect ### merge with case below - geometry = qt_mac_toQRect([self bounds]); + geometry = QRectF::fromCGRect([self bounds]).toRect(); } else { // child window, use the frame rect - geometry = qt_mac_toQRect([self frame]); + geometry = QRectF::fromCGRect([self frame]).toRect(); } if (m_platformWindow->m_nsWindow && geometry == m_platformWindow->geometry()) @@ -555,7 +555,7 @@ static bool _q_dontOverrideCtrlLMB = false; - (void) drawRect:(NSRect)dirtyRect { - qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_window << qt_mac_toQRect(dirtyRect); + qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_window << QRectF::fromCGRect(dirtyRect); #ifndef QT_NO_OPENGL if (m_glContext && m_shouldSetGLContextinDrawRect) { -- cgit v1.2.3