diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiostextinputoverlay.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiostextinputoverlay.mm | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm index 733367f3be..ff260d02dc 100644 --- a/src/plugins/platforms/ios/qiostextinputoverlay.mm +++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm @@ -136,7 +136,7 @@ static void executeBlockWithoutAnimation(Block block) // 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]; @@ -496,12 +496,12 @@ static void executeBlockWithoutAnimation(Block block) QGuiApplication::styleHints()->setCursorFlashTime(0); if (!_loupeLayer) [self createLoupe]; - [self updateFocalPoint:fromCGPoint(_lastTouchPoint)]; + [self updateFocalPoint:QPointF::fromCGPoint(_lastTouchPoint)]; _loupeLayer.visible = YES; break; case UIGestureRecognizerStateChanged: // Tell the sub class to move the loupe to the correct position - [self updateFocalPoint:fromCGPoint(_lastTouchPoint)]; + [self updateFocalPoint:QPointF::fromCGPoint(_lastTouchPoint)]; break; case UIGestureRecognizerStateEnded: // Restore cursor blinking, and hide the loupe @@ -526,12 +526,12 @@ static void executeBlockWithoutAnimation(Block block) - (QPointF)focalPoint { - return fromCGPoint([_loupeLayer.targetView convertPoint:_loupeLayer.focalPoint toView:_focusView]); + return QPointF::fromCGPoint([_loupeLayer.targetView convertPoint:_loupeLayer.focalPoint toView:_focusView]); } - (void)setFocalPoint:(QPointF)point { - _loupeLayer.focalPoint = [_loupeLayer.targetView convertPoint:toCGPoint(point) fromView:_focusView]; + _loupeLayer.focalPoint = [_loupeLayer.targetView convertPoint:point.toCGPoint() fromView:_focusView]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event @@ -548,7 +548,7 @@ static void executeBlockWithoutAnimation(Block block) // If the touch point is accepted by the sub class (e.g touch on cursor), we start a // press'n'hold timer that eventually will move the state to UIGestureRecognizerStateBegan. - if ([self acceptTouchesBegan:fromCGPoint(_firstTouchPoint)]) + if ([self acceptTouchesBegan:QPointF::fromCGPoint(_firstTouchPoint)]) _triggerStateBeganTimer.start(); else self.state = UIGestureRecognizerStateFailed; @@ -856,8 +856,8 @@ static void executeBlockWithoutAnimation(Block block) // 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 @@ -866,7 +866,7 @@ static void executeBlockWithoutAnimation(Block block) 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; @@ -934,7 +934,7 @@ static void executeBlockWithoutAnimation(Block block) } QRectF inputRect = QGuiApplication::inputMethod()->inputItemClipRectangle(); - QPointF touchPos = fromCGPoint([static_cast<UITouch *>([touches anyObject]) locationInView:_focusView]); + QPointF touchPos = QPointF::fromCGPoint([static_cast<UITouch *>([touches anyObject]) locationInView:_focusView]); if (!inputRect.contains(touchPos)) self.state = UIGestureRecognizerStateFailed; @@ -943,7 +943,7 @@ static void executeBlockWithoutAnimation(Block block) - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { - QPointF touchPos = fromCGPoint([static_cast<UITouch *>([touches anyObject]) locationInView:_focusView]); + QPointF touchPos = QPointF::fromCGPoint([static_cast<UITouch *>([touches anyObject]) locationInView:_focusView]); const QTransform mapToLocal = QGuiApplication::inputMethod()->inputItemTransform().inverted(); int cursorPosOnRelease = QInputMethod::queryFocusObject(Qt::ImCursorPosition, touchPos * mapToLocal).toInt(); |