From a80d2c73c1ec98c5b3d3d9319a735d822d6b5dff Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Tue, 20 Mar 2012 18:52:50 +0200 Subject: Fix QWidgetTextController issue when used with QtQuick1 TextEdit Calling QInputMethod::invokeAction() was not checking for proper event type and was requiring context widget unnecessarily. Fixes some parts of QTBUG-24035 Change-Id: I51fe9ed02a018ced36319eb672a088503649b275 Reviewed-by: Andrew den Exter --- src/widgets/widgets/qwidgettextcontrol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 9eeffc1231..86dfb30389 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -1829,7 +1829,7 @@ bool QWidgetTextControlPrivate::sendMouseEventToInputContext( #if !defined(QT_NO_IM) Q_Q(QWidgetTextControl); - if (contextWidget && isPreediting()) { + if (isPreediting()) { QTextLayout *layout = cursor.block().layout(); int cursorPos = q->hitTest(pos, Qt::FuzzyHit) - cursor.position(); @@ -1837,7 +1837,7 @@ bool QWidgetTextControlPrivate::sendMouseEventToInputContext( cursorPos = -1; if (cursorPos >= 0) { - if (e->type() == QEvent::MouseButtonRelease) + if (eventType == QEvent::MouseButtonRelease) qApp->inputMethod()->invokeAction(QInputMethod::Click, cursorPos); e->setAccepted(true); -- cgit v1.2.3