diff options
author | axis <qt-info@nokia.com> | 2009-04-07 14:28:57 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-05-04 13:24:07 (GMT) |
commit | 0bc0c1c9b09cda459dbfdc16cb4089297160ce85 (patch) | |
tree | 9b619fc14285c3fd1b7dd7598c7f4b4301cc7f33 /src/gui | |
parent | 8d08c42c6a5478e8890d59f58483f4eff3d286ca (diff) | |
download | Qt-0bc0c1c9b09cda459dbfdc16cb4089297160ce85.zip Qt-0bc0c1c9b09cda459dbfdc16cb4089297160ce85.tar.gz Qt-0bc0c1c9b09cda459dbfdc16cb4089297160ce85.tar.bz2 |
Implemented RequestSoftwareInputPanel events in QLineEdit.
AutoTest: Included
RevBy: denis
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.h | 4 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 8b553f9..d03cd3e 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1768,6 +1768,13 @@ void QLineEdit::mouseReleaseEvent(QMouseEvent* e) } } #endif + + if (e->button() == Qt::LeftButton && (!d->clickCausedFocus + || QApplication::autoSipOnMouseFocus())) { + QEvent event(QEvent::RequestSoftwareInputPanel); + QApplication::sendEvent(this, &event); + } + d->clickCausedFocus = 0; } /*! \reimp @@ -2350,6 +2357,8 @@ void QLineEdit::focusInEvent(QFocusEvent *e) d->moveCursor(d->nextMaskBlank(0)); else if (!d->hasSelectedText()) selectAll(); + } else if (e->reason() == Qt::MouseFocusReason) { + d->clickCausedFocus = 1; } #ifdef QT_KEYPAD_NAVIGATION if (!QApplication::keypadNavigationEnabled() || (hasEditFocus() && e->reason() == Qt::PopupFocusReason)) diff --git a/src/gui/widgets/qlineedit_p.h b/src/gui/widgets/qlineedit_p.h index 532528b..3db903f 100644 --- a/src/gui/widgets/qlineedit_p.h +++ b/src/gui/widgets/qlineedit_p.h @@ -76,7 +76,8 @@ public: : cursor(0), preeditCursor(0), cursorTimer(0), frame(1), cursorVisible(0), hideCursor(false), separator(0), readOnly(0), dragEnabled(0), contextMenuEnabled(1), echoMode(0), textDirty(0), - selDirty(0), validInput(1), alignment(Qt::AlignLeading | Qt::AlignVCenter), ascent(0), + selDirty(0), validInput(1), clickCausedFocus(0), + alignment(Qt::AlignLeading | Qt::AlignVCenter), ascent(0), maxLength(32767), hscroll(0), vscroll(0), lastCursorPos(-1), maskData(0), modifiedState(0), undoState(0), selstart(0), selend(0), userInput(false), emitingEditingFinished(false), passwordEchoEditing(false) @@ -110,6 +111,7 @@ public: uint textDirty : 1; uint selDirty : 1; uint validInput : 1; + uint clickCausedFocus : 1; uint alignment; int ascent; int maxLength; |