diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2011-12-15 14:42:07 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-20 12:57:38 +0100 |
commit | b652cc8d20788c0e2d016d254c82e8ad879e086d (patch) | |
tree | a7f091cfbf040840a839e2e1d5ac6a04e2db228b /src/widgets | |
parent | a1743e46813dc146ff71b8146d3a8bf16a2589b6 (diff) |
Adapt from input context mousehandler to input panel in QLineEdit
Change-Id: If14d0cc18188da1dbc8b152fa2fa9583ff03b3bc
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qlineedit_p.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
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; } } |