aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@digia.com>2013-11-26 16:56:00 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-27 14:19:13 +0100
commit956ee62cc24c76569ac49ab209f5f889899c53d6 (patch)
treea33c1b6a8d97df843bacf0469b378c7233ee21e3 /src/quick
parent7811c22f8a18d14b33c04ca00e6b2b6ea5aef8df (diff)
TextInput: call fixup() when appropriate
[ChangeLog][QtQuick] Fixed TextInput to call fixup() on its validator when being accepted or losing focus, and the validator reports that the input is in "intermediate" state ie. the input should be fixed up. Task-number: QTBUG-35128 Change-Id: I4b15406c584a9647bcf892badfaf6d845868fbf1 Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktextinput.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index c56f3648e6..d4427eb47e 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -2533,7 +2533,7 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)
&& !persistentSelection)
deselect();
- if (hasAcceptableInput(m_text) || fixup())
+ if (q->hasAcceptableInput() || fixup())
emit q->editingFinished();
#ifndef QT_NO_IM
@@ -4117,7 +4117,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
Q_Q(QQuickTextInput);
if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) {
- if (hasAcceptableInput(m_text) || fixup()) {
+ if (q->hasAcceptableInput() || fixup()) {
emit q->accepted();
emit q->editingFinished();
}