diff options
author | Liang Qi <liang.qi@digia.com> | 2013-11-14 10:35:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-22 13:02:21 +0100 |
commit | 20db3ac1e11d528ab2a924fd10764d903e8c1b4b (patch) | |
tree | 8a4e436239c721904eccb8c619ba3e2db84efcc8 /src | |
parent | 692211670b377014c4dcf7b6819723bbeb2ffa66 (diff) | |
download | qtquickcontrols-20db3ac1e11d528ab2a924fd10764d903e8c1b4b.tar.gz qtquickcontrols-20db3ac1e11d528ab2a924fd10764d903e8c1b4b.tar.bz2 qtquickcontrols-20db3ac1e11d528ab2a924fd10764d903e8c1b4b.zip |
TextField: add editingFinished signal
Autotest is included.
Task-number: QTBUG-34780
Change-Id: I19e73ca0c988a9d294aca52f9c0eabb9274f40d7
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/controls/TextField.qml | 16 |
1 files changed, 15 insertions, 1 deletions
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 @@ -403,6 +403,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() Copies the currently selected text to the system clipboard. @@ -591,5 +603,7 @@ Control { Qt.inputMethod.hide() textfield.accepted() } + + onEditingFinished: textfield.editingFinished() } } |