diff options
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm')
-rw-r--r-- | src/plugins/platforms/ios/qiosinputcontext.mm | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index ef93d68cf0..c6cbb9b101 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -117,6 +117,7 @@ static QUIView *focusView() self.cancelsTouchesInView = NO; self.delaysTouchesEnded = NO; +#ifndef Q_OS_TVOS NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self @@ -134,6 +135,7 @@ static QUIView *focusView() [notificationCenter addObserver:self selector:@selector(keyboardDidChangeFrame:) name:UIKeyboardDidChangeFrameNotification object:nil]; +#endif } return self; @@ -377,6 +379,9 @@ void QIOSInputContext::clearCurrentFocusObject() void QIOSInputContext::updateKeyboardState(NSNotification *notification) { +#ifdef Q_OS_TVOS + Q_UNUSED(notification); +#else static CGRect currentKeyboardRect = CGRectZero; KeyboardState previousState = m_keyboardState; @@ -412,7 +417,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"); @@ -421,7 +426,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) @@ -430,6 +435,7 @@ void QIOSInputContext::updateKeyboardState(NSNotification *notification) emitAnimatingChanged(); if (m_keyboardState.keyboardRect != previousState.keyboardRect) emitKeyboardRectChanged(); +#endif } bool QIOSInputContext::isInputPanelVisible() const @@ -549,7 +555,11 @@ void QIOSInputContext::scroll(int y) if (keyboardScrollIsActive && !originalWindowLevels.contains(window)) originalWindowLevels.insert(window, window.windowLevel); +#ifndef Q_OS_TVOS UIWindowLevel windowLevelAdjustment = keyboardScrollIsActive ? UIWindowLevelStatusBar : 0; +#else + UIWindowLevel windowLevelAdjustment = 0; +#endif window.windowLevel = originalWindowLevels.value(window) + windowLevelAdjustment; if (!keyboardScrollIsActive) |