"max"
Defines the maximum value that can be entered in a text field.
Synopsis
setValue(string shape, "max", anytype limit);
getValue(string shape, "max", anytype limit);
shape.max( anytype limit);
Parameters
Parameter | Description |
---|---|
shape | Name of the object |
limit | The maximum value |
Details
The attribute "max" sets the maximum value that can be entered in a text field
Note: Please note the specific behavior as stated within the official Qt documentation
when using
int
input values for a text field with defined maximum
value: Qt - QIntValidator Class DetailsThe following example sets the maximum value to 50. You cannot enter a value bigger than 50. If you want to enter e.g. the number 51, the text field accepts the digit 5. However, after that, the digits 1 to 9 are blocked and will not be accepted by the text field.
main()
{
this.max(50);
}
main()
{
setValue("", "max", 50);
}