summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qwidgetlinecontrol.cpp
diff options
context:
space:
mode:
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>2012-02-28 13:35:17 +0200
committerQt by Nokia <qt-info@nokia.com>2012-03-27 12:51:38 +0200
commit0ee1b4a1dea8b587a5d39bfeb7e18c97f13dd877 (patch)
tree72069427d47ad395a9b9a29ccbf5e5c69ebc0c93 /src/widgets/widgets/qwidgetlinecontrol.cpp
parent4f92f9b7251addef556b25e8ab88e00acfaf61b0 (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/qwidgetlinecontrol.cpp')
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp29
1 files changed, 4 insertions, 25 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index b4a7007190..20af574049 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -184,21 +184,15 @@ void QWidgetLineControl::paste(QClipboard::Mode clipboardMode)
/*!
\internal
-
- Exits preedit mode and commits parts marked as tentative commit
*/
void QWidgetLineControl::commitPreedit()
{
if (!composeMode())
return;
- qApp->inputMethod()->reset();
-
- if (!m_tentativeCommit.isEmpty()) {
- internalInsert(m_tentativeCommit);
- m_tentativeCommit.clear();
- finishChange(-1, true/*not used, not documented*/, false);
- }
+ qApp->inputMethod()->commit();
+ if (!composeMode())
+ return;
m_preeditCursor = 0;
setPreeditArea(-1, QString());
@@ -573,13 +567,7 @@ void QWidgetLineControl::processInputMethodEvent(QInputMethodEvent *event)
else if (m_preeditCursor != oldPreeditCursor)
emit updateMicroFocus();
- bool tentativeCommitChanged = (m_tentativeCommit != event->tentativeCommitString());
- if (tentativeCommitChanged) {
- m_textDirty = true;
- m_tentativeCommit = event->tentativeCommitString();
- }
-
- if (isGettingInput || tentativeCommitChanged)
+ if (isGettingInput)
finishChange(priorState);
if (selectionChange)
@@ -687,15 +675,6 @@ bool QWidgetLineControl::finishChange(int validateFromState, bool update, bool e
return true;
}
m_cursor = cursorCopy;
-
- if (!m_tentativeCommit.isEmpty()) {
- textCopy.insert(m_cursor, m_tentativeCommit);
- bool validInput = (m_validator->validate(textCopy, cursorCopy) != QValidator::Invalid);
- if (!validInput)
- m_tentativeCommit.clear();
- }
- } else {
- m_tentativeCommit.clear();
}
}
#endif