From 956ee62cc24c76569ac49ab209f5f889899c53d6 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 26 Nov 2013 16:56:00 +0100 Subject: 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 --- src/quick/items/qquicktextinput.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/quick') 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(); } -- cgit v1.2.3