summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosinputcontext.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm')
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm70
1 files changed, 38 insertions, 32 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index d03c589b2a..d553d16698 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -1,31 +1,37 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the plugins of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -221,7 +227,7 @@ static QUIView *focusView()
Q_UNUSED(sender);
if (self.state == UIGestureRecognizerStateBegan) {
- qImDebug() << "hide keyboard gesture was triggered";
+ qImDebug("hide keyboard gesture was triggered");
UIResponder *firstResponder = [UIResponder currentFirstResponder];
Q_ASSERT([firstResponder isKindOfClass:[QIOSTextInputResponder class]]);
[firstResponder resignFirstResponder];
@@ -233,12 +239,12 @@ static QUIView *focusView()
[super reset];
if (!m_context->isInputPanelVisible()) {
- qImDebug() << "keyboard was hidden, disabling hide-keyboard gesture";
+ qImDebug("keyboard was hidden, disabling hide-keyboard gesture");
self.enabled = NO;
} else {
- qImDebug() << "gesture completed without triggering";
+ qImDebug("gesture completed without triggering");
if (self.hasDeferredScrollToCursor) {
- qImDebug() << "applying deferred scroll to cursor";
+ qImDebug("applying deferred scroll to cursor");
m_context->scrollToCursor();
}
}
@@ -307,22 +313,22 @@ QIOSInputContext::~QIOSInputContext()
void QIOSInputContext::showInputPanel()
{
// No-op, keyboard controlled fully by platform based on focus
- qImDebug() << "can't show virtual keyboard without a focus object, ignoring";
+ qImDebug("can't show virtual keyboard without a focus object, ignoring");
}
void QIOSInputContext::hideInputPanel()
{
if (![m_textResponder isFirstResponder]) {
- qImDebug() << "QIOSTextInputResponder is not first responder, ignoring";
+ qImDebug("QIOSTextInputResponder is not first responder, ignoring");
return;
}
if (qGuiApp->focusObject() != m_imeState.focusObject) {
- qImDebug() << "current focus object does not match IM state, likely hiding from focusOut event, so ignoring";
+ qImDebug("current focus object does not match IM state, likely hiding from focusOut event, so ignoring");
return;
}
- qImDebug() << "hiding VKB as requested by QInputMethod::hide()";
+ qImDebug("hiding VKB as requested by QInputMethod::hide()");
[m_textResponder resignFirstResponder];
}
@@ -374,7 +380,7 @@ void QIOSInputContext::updateKeyboardState(NSNotification *notification)
qImDebug() << qPrintable(QString::fromNSString(notification.name)) << "from" << fromCGRect(frameBegin) << "to" << 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";
+ qImDebug("No notification to update keyboard state based on, just updating keyboard rect");
}
if (!focusView() || CGRectIsEmpty(currentKeyboardRect))
@@ -428,7 +434,7 @@ void QIOSInputContext::scrollToCursor()
if (m_keyboardHideGesture.state == UIGestureRecognizerStatePossible && m_keyboardHideGesture.numberOfTouches == 1) {
// Don't scroll to the cursor if the user is touching the screen and possibly
// trying to trigger the hide-keyboard gesture.
- qImDebug() << "deferring scrolling to cursor as we're still waiting for a possible gesture";
+ qImDebug("deferring scrolling to cursor as we're still waiting for a possible gesture");
m_keyboardHideGesture.hasDeferredScrollToCursor = YES;
return;
}
@@ -445,7 +451,7 @@ void QIOSInputContext::scrollToCursor()
// We only support auto-scroll for docked keyboards for now, so make sure that's the case
if (CGRectGetMaxY(m_keyboardState.keyboardEndRect) != CGRectGetMaxY([UIScreen mainScreen].bounds)) {
- qImDebug() << "Keyboard not docked, ignoring request to scroll to reveal cursor";
+ qImDebug("Keyboard not docked, ignoring request to scroll to reveal cursor");
return;
}
@@ -544,7 +550,7 @@ void QIOSInputContext::setFocusObject(QObject *focusObject)
clearCurrentFocusObject();
return;
} else if (focusObject == m_imeState.focusObject) {
- qImDebug() << "same focus object as last update, skipping reset";
+ qImDebug("same focus object as last update, skipping reset");
return;
}
@@ -588,23 +594,23 @@ void QIOSInputContext::update(Qt::InputMethodQueries updatedProperties)
if (inputMethodAccepted()) {
if (!m_textResponder || [m_textResponder needsKeyboardReconfigure:changedProperties]) {
- qImDebug() << "creating new text responder";
+ qImDebug("creating new text responder");
[m_textResponder autorelease];
m_textResponder = [[QIOSTextInputResponder alloc] initWithInputContext:this];
} else {
- qImDebug() << "no need to reconfigure keyboard, just notifying input delegate";
+ qImDebug("no need to reconfigure keyboard, just notifying input delegate");
[m_textResponder notifyInputDelegate:changedProperties];
}
if (![m_textResponder isFirstResponder]) {
- qImDebug() << "IM enabled, making text responder first responder";
+ qImDebug("IM enabled, making text responder first responder");
[m_textResponder becomeFirstResponder];
}
if (changedProperties & Qt::ImCursorRectangle)
scrollToCursor();
} else if ([m_textResponder isFirstResponder]) {
- qImDebug() << "IM not enabled, resigning text responder as first responder";
+ qImDebug("IM not enabled, resigning text responder as first responder");
[m_textResponder resignFirstResponder];
}
}
@@ -634,7 +640,7 @@ bool QIOSInputContext::inputMethodAccepted() const
*/
void QIOSInputContext::reset()
{
- qImDebug() << "updating Qt::ImQueryAll and unmarking text";
+ qImDebug("updating Qt::ImQueryAll and unmarking text");
update(Qt::ImQueryAll);
@@ -652,7 +658,7 @@ void QIOSInputContext::reset()
*/
void QIOSInputContext::commit()
{
- qImDebug() << "unmarking text";
+ qImDebug("unmarking text");
[m_textResponder unmarkText];
[m_textResponder notifyInputDelegate:Qt::ImSurroundingText];