summaryrefslogtreecommitdiff
path: root/src/controls/SpinBox.qml
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@digia.com>2013-11-19 15:14:50 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-22 13:02:25 +0100
commit3be9c4bca30acf109cda87a9c53849ba328c45db (patch)
treec300dd2033aa47d357bcf68560b6cda5d40625e4 /src/controls/SpinBox.qml
parent20db3ac1e11d528ab2a924fd10764d903e8c1b4b (diff)
downloadqtquickcontrols-3be9c4bca30acf109cda87a9c53849ba328c45db.tar.gz
SpinBox: add editingFinished signal
Autotest is included. Task-number: QTBUG-34780 Change-Id: I2da9d57b409c24cbf1d90ce42da9b4071dd6dac8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/SpinBox.qml')
-rw-r--r--src/controls/SpinBox.qml15
1 files changed, 14 insertions, 1 deletions
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"