diff options
| author | Fabian Kosmale <fabian.kosmale@qt.io> | 2025-10-09 10:46:40 +0200 |
|---|---|---|
| committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2025-10-10 19:31:35 +0200 |
| commit | b4a207af6943f63e598aee0a74c102a14cf26b71 (patch) | |
| tree | 82b82b0362cf330d29e52b84c02a3227c78ebf66 /src/quick/doc/snippets/qml/intvalidator.qml | |
| parent | 96764ff52393abc81aae1b72946297ccb7e7d507 (diff) | |
IntValidator docs: Provide guidance on intermediate results
Validators in QML do not actually expose the three states (Valid,
Invalid, Intermediate) directly, but only support their usage through
TextField. This makes it slightly tricky to raise awareness about
intermediate results.
Nevertheless, we can expand the example to avoid confusion how
IntValidator restricts input, and to encourage users to create a
visual indicator based on acceptableInput.
The color can also be a binding in the snippet. Amends
17a777a5dfa72e47d02c3e6b4c3a137d923d50bc
Pick-to: 6.10 6.8
Fixes: QTBUG-85490
Change-Id: Ia3f7d21d6d7c13943cc2469c4ab8f3c00fd2eada
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/doc/snippets/qml/intvalidator.qml')
| -rw-r--r-- | src/quick/doc/snippets/qml/intvalidator.qml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/doc/snippets/qml/intvalidator.qml b/src/quick/doc/snippets/qml/intvalidator.qml index 71ba774299..f08732742b 100644 --- a/src/quick/doc/snippets/qml/intvalidator.qml +++ b/src/quick/doc/snippets/qml/intvalidator.qml @@ -10,7 +10,6 @@ TextInput { bottom: 0 top: 100 } - onAcceptableInputChanged: - color = acceptableInput ? "black" : "red"; + color: acceptableInput ? "black" : "red"; } //![0] |
