From b652cc8d20788c0e2d016d254c82e8ad879e086d Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 15 Dec 2011 14:42:07 +0200 Subject: Adapt from input context mousehandler to input panel in QLineEdit Change-Id: If14d0cc18188da1dbc8b152fa2fa9583ff03b3bc Reviewed-by: Lars Knoll Reviewed-by: Joona Petrell --- src/widgets/widgets/qlineedit_p.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index b17651e1d3..f700588fdb 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -51,7 +51,7 @@ #include "qaccessible.h" #endif #ifndef QT_NO_IM -#include "qinputcontext.h" +#include "qinputpanel.h" #include "qlist.h" #endif @@ -249,23 +249,22 @@ void QLineEditPrivate::resetInputPanel() /*! This function is not intended as polymorphic usage. Just a shared code - fragment that calls QInputContext::mouseHandler for this + fragment that calls QInputPanel::invokeAction for this class. */ bool QLineEditPrivate::sendMouseEventToInputContext( QMouseEvent *e ) { #if !defined QT_NO_IM - Q_Q(QLineEdit); if ( control->composeMode() ) { int tmp_cursor = xToPos(e->pos().x()); int mousePos = tmp_cursor - control->cursor(); if ( mousePos < 0 || mousePos > control->preeditAreaText().length() ) mousePos = -1; - QInputContext *qic = q->inputContext(); - if (qic && mousePos >= 0) { - // may be causing reset() in some input methods - qic->mouseHandler(mousePos, e); + if (mousePos >= 0) { + if (e->type() == QEvent::MouseButtonRelease) + qApp->inputPanel()->invokeAction(QInputPanel::Click, mousePos); + return true; } } -- cgit v1.2.3