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/qiosinputcontext.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/qiosinputcontext.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosinputcontext.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 20d1670681..a1c51b6968 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -382,7 +382,7 @@ void QIOSInputContext::updateKeyboardState(NSNotification *notification) m_keyboardState.animationDuration = [[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; m_keyboardState.keyboardAnimating = m_keyboardState.animationDuration > 0 && !atEndOfKeyboardTransition; - qImDebug() << qPrintable(QString::fromNSString(notification.name)) << "from" << fromCGRect(frameBegin) << "to" << fromCGRect(frameEnd) + qImDebug() << qPrintable(QString::fromNSString(notification.name)) << "from" << QRectF::fromCGRect(frameBegin) << "to" << QRectF::fromCGRect(frameEnd) << "(curve =" << m_keyboardState.animationCurve << "duration =" << m_keyboardState.animationDuration << "s)"; } else { qImDebug("No notification to update keyboard state based on, just updating keyboard rect"); @@ -391,7 +391,7 @@ void QIOSInputContext::updateKeyboardState(NSNotification *notification) if (!focusView() || CGRectIsEmpty(currentKeyboardRect)) m_keyboardState.keyboardRect = QRectF(); else // QInputmethod::keyboardRectangle() is documented to be in window coordinates. - m_keyboardState.keyboardRect = fromCGRect([focusView() convertRect:currentKeyboardRect fromView:nil]); + m_keyboardState.keyboardRect = QRectF::fromCGRect([focusView() convertRect:currentKeyboardRect fromView:nil]); // Emit for all changed properties if (m_keyboardState.keyboardVisible != previousState.keyboardVisible) |