diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2013-09-10 12:44:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-10 16:20:24 +0200 |
commit | 6bcacdecb8445a5ad9a31f6bdac99cde076e6295 (patch) | |
tree | 2abbb1022343dec02663ce1656412ecad383782e /tests/auto/controls/data/tst_spinbox.qml | |
parent | 5520918af2cfb00618765820df2a28916a12c626 (diff) | |
download | qtquickcontrols-6bcacdecb8445a5ad9a31f6bdac99cde076e6295.tar.gz |
Fix incorrect spinbox validation at startup
The problem was that the validator was applied during the
object creation which means the incorrect decimal values were applied
and the initial value was incorrectly changed.
Task-number: QTBUG-33309
Change-Id: Ic1ace174b9059b9c6ce24fd88b81c5edd7318e80
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_spinbox.qml')
-rw-r--r-- | tests/auto/controls/data/tst_spinbox.qml | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml index 267e9c4b..ed39f080 100644 --- a/tests/auto/controls/data/tst_spinbox.qml +++ b/tests/auto/controls/data/tst_spinbox.qml @@ -87,6 +87,16 @@ Item { spinbox.destroy() } + function test_initial_value() { + var spinbox = Qt.createQmlObject('import QtQuick.Controls 1.0; SpinBox {decimals: 3 ; value: 0.25}', container, '') + compare(spinbox.value, 0.25) + spinbox.destroy() + + spinbox = Qt.createQmlObject('import QtQuick.Controls 1.0; SpinBox {value: 0.25 ; decimals: 3}', container, '') + compare(spinbox.value, 0.25) + spinbox.destroy() + } + function test_keyboard_input_data() { return [ {tag: "1", input: [Qt.Key_1], value: 1}, |