在 JavaScript 中,最高的整数是通过
QML 中是否有针对整数或浮点数的常量?
Number.MAX_SAFE_INTEGER.
同时在C ++中可以使用std获得:
std::numeric_limits<int>::max()
QML 中是否有针对整数或浮点数的常量?
-Infinity
和Infinity
,或者Number.NEGATIVE_INFINITY
和Number.POSITIVE_INFINITY
。另一个选择是使用IntValidator。默认情况下,top和bottom属性包含Qt int值的最大值和最小值。
readonly property IntValdiator intValdiator: IntValidator {}
readonly property int MAX_VALUE: intValidator.top
readonly property int MIN_VALUE: intValidator.bottom
Number.MAX_VALUE
。 - BaCaRoZzoint
可以正常工作,因为它在这个范围内,但它自己的范围相当有限。 - dtech