summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-02-07 15:52:44 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-14 00:34:25 +0100
commite33eb158116421b0ef87bbae25cecabdb84a2509 (patch)
tree0c3e90f26a158c28d972ea7529c85ef17d9265e6 /src/plugins
parent8dcb72fd1e2c17ad000474496b6d000580e0a943 (diff)
iOS: don't store reference to focus object
Sometimes focus object is updated after we get a callback that the cursor rectangle has changed. And there is no reason to keep a local reference to it. Since we also send events to the qApp->focusObject from UIView_textInput, we now end up more consistent. Change-Id: I3976175aae4e3f346be9bc5b771ac0fdefc03ae6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.h1
-rw-r--r--src/plugins/platforms/ios/qiosinputcontext.mm5
2 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h
index aec1686b93..13255ada56 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.h
+++ b/src/plugins/platforms/ios/qiosinputcontext.h
@@ -77,7 +77,6 @@ private:
QIOSKeyboardListener *m_keyboardListener;
QUIView *m_focusView;
bool m_hasPendingHideRequest;
- QObject *m_focusObject;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm
index 15f5082f62..d426028c46 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.mm
+++ b/src/plugins/platforms/ios/qiosinputcontext.mm
@@ -179,7 +179,6 @@ QIOSInputContext::QIOSInputContext()
, m_keyboardListener([[QIOSKeyboardListener alloc] initWithQIOSInputContext:this])
, m_focusView(0)
, m_hasPendingHideRequest(false)
- , m_focusObject(0)
{
if (isQtApplication())
connect(qGuiApp->inputMethod(), &QInputMethod::cursorRectangleChanged, this, &QIOSInputContext::cursorRectangleChanged);
@@ -227,8 +226,6 @@ bool QIOSInputContext::isInputPanelVisible() const
void QIOSInputContext::setFocusObject(QObject *focusObject)
{
- m_focusObject = focusObject;
-
if (!focusObject || !m_focusView || !m_focusView.isFirstResponder) {
scroll(0);
return;
@@ -262,7 +259,7 @@ void QIOSInputContext::cursorRectangleChanged()
// itself moves, we need to ask the focus object for ImCursorRectangle:
static QPoint prevCursor;
QInputMethodQueryEvent queryEvent(Qt::ImCursorRectangle);
- QCoreApplication::sendEvent(m_focusObject, &queryEvent);
+ QCoreApplication::sendEvent(qApp->focusObject(), &queryEvent);
QPoint cursor = queryEvent.value(Qt::ImCursorRectangle).toRect().topLeft();
if (cursor != prevCursor)
scrollToCursor();