From 3be9c4bca30acf109cda87a9c53849ba328c45db Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 19 Nov 2013 15:14:50 +0100 Subject: SpinBox: add editingFinished signal Autotest is included. Task-number: QTBUG-34780 Change-Id: I2da9d57b409c24cbf1d90ce42da9b4071dd6dac8 Reviewed-by: J-P Nurmi --- src/controls/SpinBox.qml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/controls') diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml index bba4eae1..c756566d 100644 --- a/src/controls/SpinBox.qml +++ b/src/controls/SpinBox.qml @@ -38,7 +38,7 @@ ** ****************************************************************************/ -import QtQuick 2.1 +import QtQuick 2.2 import QtQuick.Controls 1.1 import QtQuick.Controls.Private 1.0 @@ -164,6 +164,17 @@ Control { */ readonly property alias hovered: mouseArea.containsMouse + /*! + \qmlsignal SpinBox::editingFinished() + \since 5.2 + + This signal is emitted when the Return or Enter key is pressed or + the control loses focus. Note that if there is a validator + set on the control and enter/return is pressed, this signal will + only be emitted if the validator returns an acceptable state. + */ + signal editingFinished() + style: Qt.createComponent(Settings.style + "/SpinBoxStyle.qml", spinbox) /*! \internal */ @@ -255,6 +266,8 @@ Control { selectValue() } + onEditingFinished: spinbox.editingFinished() + color: __panel ? __panel.foregroundColor : "black" selectionColor: __panel ? __panel.selectionColor : "black" selectedTextColor: __panel ? __panel.selectedTextColor : "black" -- cgit v1.2.1