diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-05-13 13:30:46 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-06-10 23:47:15 +0000 |
commit | ebee64645a672e82ffca3b48dbc007cd2f2a52f4 (patch) | |
tree | 0ab5e31523110666cac37f2b8cb76235efab929b /src/plugins/platforms/ios/qiostextinputoverlay.mm | |
parent | cbe62a0e6d0caba8dcb0a63d3af3c458a6298e10 (diff) |
darwin: Add Foundation conversion functions for QRect/QRectF
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 <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiostextinputoverlay.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiostextinputoverlay.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm index 3fa9341540..655e457664 100644 --- a/src/plugins/platforms/ios/qiostextinputoverlay.mm +++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm @@ -135,7 +135,7 @@ static void executeBlockWithoutAnimation(void (^block)(void)) // first responder, which is normally QIOSTextResponder. QRectF cr = qApp->inputMethod()->cursorRectangle(); QRectF ar = qApp->inputMethod()->anchorRectangle(); - CGRect targetRect = toCGRect(cr.united(ar)); + CGRect targetRect = cr.united(ar).toCGRect(); UIView *focusView = reinterpret_cast<UIView *>(qApp->focusWindow()->winId()); [[UIMenuController sharedMenuController] setTargetRect:targetRect inView:focusView]; [[UIMenuController sharedMenuController] setMenuVisible:YES animated:YES]; @@ -826,8 +826,8 @@ static void executeBlockWithoutAnimation(void (^block)(void)) // Adjust handles and input rect to match the new selection QRectF inputRect = QGuiApplication::inputMethod()->inputItemClipRectangle(); - CGRect cursorRect = toCGRect(QGuiApplication::inputMethod()->cursorRectangle()); - CGRect anchorRect = toCGRect(QGuiApplication::inputMethod()->anchorRectangle()); + CGRect cursorRect = QGuiApplication::inputMethod()->cursorRectangle().toCGRect(); + CGRect anchorRect = QGuiApplication::inputMethod()->anchorRectangle().toCGRect(); if (!_multiLine) { // Resize the layer a bit bigger to ensure that the handles are @@ -836,7 +836,7 @@ static void executeBlockWithoutAnimation(void (^block)(void)) inputRect.adjust(-margin / 2, -margin, margin / 2, margin); } - executeBlockWithoutAnimation(^{ _clipRectLayer.frame = toCGRect(inputRect); }); + executeBlockWithoutAnimation(^{ _clipRectLayer.frame = inputRect.toCGRect(); }); _cursorLayer.cursorRectangle = [self.focusView.layer convertRect:cursorRect toLayer:_clipRectLayer]; _anchorLayer.cursorRectangle = [self.focusView.layer convertRect:anchorRect toLayer:_clipRectLayer]; _cursorLayer.visible = YES; |