From 20db3ac1e11d528ab2a924fd10764d903e8c1b4b Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 14 Nov 2013 10:35:13 +0100 Subject: TextField: add editingFinished signal Autotest is included. Task-number: QTBUG-34780 Change-Id: I19e73ca0c988a9d294aca52f9c0eabb9274f40d7 Reviewed-by: J-P Nurmi --- src/controls/TextField.qml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml index c1e3ddab..0961430d 100644 --- a/src/controls/TextField.qml +++ b/src/controls/TextField.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Private 1.0 @@ -402,6 +402,18 @@ Control { */ signal accepted() + /*! + \qmlsignal TextField::editingFinished() + \since 5.2 + + This signal is emitted when the Return or Enter key is pressed or + the text field loses focus. Note that if there is a validator or + inputMask set on the text field and enter/return is pressed, this + signal will only be emitted if the input follows + the inputMask and the validator returns an acceptable state. + */ + signal editingFinished() + /*! \qmlmethod TextField::copy() @@ -591,5 +603,7 @@ Control { Qt.inputMethod.hide() textfield.accepted() } + + onEditingFinished: textfield.editingFinished() } } -- cgit v1.2.3