IntValidator QML Type
整数値用のバリデータを定義します。詳細...
Import Statement: | import QtQuick |
In C++: | QIntValidator |
プロパティ
詳細な説明
IntValidator 型は整数値のバリデータを提供します。
locale が設定されていない場合、IntValidator はdefault locale を使用して数値を解釈し、 ロケール固有の数字やグループセパレータ、正負の符号を受け取ります。さらに、IntValidator は常に "C" ロケールに従ってフォーマットされた数値を受け付けることが保証されています。
次の例では、TextInput オブジェクトに IntValidator を指定して、ユーザーが指定した範囲内の整数を入力したかどうかをチェックし、無効な入力を強調するようにテキストの色を更新しています:
import QtQuick TextInput { focus: true validator: IntValidator { bottom: 0 top: 100 } onAcceptableInputChanged: color = acceptableInput ? "black" : "red"; }
DoubleValidator,RegularExpressionValidator,入力テキストの検証も参照してください 。
プロパティの説明
bottom : int |
このプロパティはバリデータの最小許容値を保持します。デフォルトでは、このプロパティの値は利用可能な最小の符号付き整数 (通常は -2147483647) に由来する。
top : int |
このプロパティは、バリデータの許容最大値を保持します。デフォルトでは、このプロパティの値は最も大きい符号つき整数値 (通常は 2147483647) となります。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.