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 /src | |
| parent | 5520918af2cfb00618765820df2a28916a12c626 (diff) | |
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 'src')
| -rw-r--r-- | src/controls/SpinBox.qml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml index b1f87cec7..6f62c3a38 100644 --- a/src/controls/SpinBox.qml +++ b/src/controls/SpinBox.qml @@ -229,8 +229,9 @@ Control { validator: SpinBoxValidator { id: validator - onTextChanged: input.text = validator.text - Component.onCompleted: input.text = validator.text + property bool ready: false // Delay validation until all properties are ready + onTextChanged: if (ready) input.text = validator.text + Component.onCompleted: {input.text = validator.text ; ready = true} } onAccepted: { input.text = validator.text |
