diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-02-28 13:35:17 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-27 12:51:38 +0200 |
commit | 0ee1b4a1dea8b587a5d39bfeb7e18c97f13dd877 (patch) | |
tree | 72069427d47ad395a9b9a29ccbf5e5c69ebc0c93 /src/widgets/widgets/qwidgettextcontrol.cpp | |
parent | 4f92f9b7251addef556b25e8ab88e00acfaf61b0 (diff) |
Reverted use of tentative commit use in QWidget editors
Feature to be reimplemented simplified. Cases when input method
needs to be reset with possibility to commit use
QInputMethod::commit() again.
Change-Id: Ibfe7aecc0799e7a76c7ac4f5d860971cfe6e97ca
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'src/widgets/widgets/qwidgettextcontrol.cpp')
-rw-r--r-- | src/widgets/widgets/qwidgettextcontrol.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp index 86dfb30389..d602d6daa5 100644 --- a/src/widgets/widgets/qwidgettextcontrol.cpp +++ b/src/widgets/widgets/qwidgettextcontrol.cpp @@ -2000,7 +2000,6 @@ void QWidgetTextControlPrivate::inputMethodEvent(QInputMethodEvent *e) } } layout->setAdditionalFormats(overrides); - tentativeCommit = e->tentativeCommitString(); cursor.endEditBlock(); @@ -2057,7 +2056,6 @@ void QWidgetTextControlPrivate::focusEvent(QFocusEvent *e) } #endif } else { - commitPreedit(); setBlinkingCursorEnabled(false); if (cursorIsFocusIndicator @@ -2758,14 +2756,12 @@ void QWidgetTextControlPrivate::commitPreedit() if (!isPreediting()) return; - cursor.beginEditBlock(); - qApp->inputMethod()->reset(); + qApp->inputMethod()->commit(); - if (!tentativeCommit.isEmpty()) { - cursor.insertText(tentativeCommit); - tentativeCommit.clear(); - } + if (!isPreediting()) + return; + cursor.beginEditBlock(); preeditCursor = 0; QTextBlock block = cursor.block(); QTextLayout *layout = block.layout(); @@ -2936,17 +2932,12 @@ bool QWidgetTextControl::find(const QString &exp, QTextDocument::FindFlags optio QString QWidgetTextControl::toPlainText() const { - Q_D(const QWidgetTextControl); - QString plainText = document()->toPlainText(); - if (!d->tentativeCommit.isEmpty()) - plainText.insert(textCursor().position(), d->tentativeCommit); - return plainText; + return document()->toPlainText(); } #ifndef QT_NO_TEXTHTMLPARSER QString QWidgetTextControl::toHtml() const { - // note: currently not including tentative commit return document()->toHtml(); } #endif |