From 0cd3416136210397ef4843224181445a81bdf0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 28 Jul 2014 13:02:07 +0200 Subject: iOS: Simplify QWindow/UIView geometry mapping As we now have a root viewcontroller that always has a geometry that matches the containing UIWindow, we don't need to do any fancy calculations when mapping between the two. Change-Id: I08a7b9992be7b7238cbad2a2da20488bba1c0939 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/ios/quiview.mm | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/plugins/platforms/ios/quiview.mm') diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 3040e89864..444017f4c7 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -135,20 +135,7 @@ // from what we end up with after applying window constraints. QRect requestedGeometry = m_qioswindow->geometry(); - QRect actualGeometry; - if (m_qioswindow->window()->isTopLevel()) { - UIWindow *uiWindow = self.window; - UIView *rootView = uiWindow.rootViewController.view; - CGRect rootViewPositionInRelationToRootViewController = - [rootView convertRect:uiWindow.bounds fromView:uiWindow]; - - actualGeometry = fromCGRect(CGRectOffset([self.superview convertRect:self.frame toView:rootView], - -rootViewPositionInRelationToRootViewController.origin.x, - -rootViewPositionInRelationToRootViewController.origin.y - + rootView.bounds.origin.y)).toRect(); - } else { - actualGeometry = fromCGRect(self.frame).toRect(); - } + QRect actualGeometry = fromCGRect(self.frame).toRect(); // Persist the actual/new geometry so that QWindow::geometry() can // be queried on the resize event. -- cgit v1.2.3