RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.integer_edit.IntegerValidator Class Reference

An input text validator that accepts integer values. More...

Inheritance diagram for gui.integer_edit.IntegerValidator:

Public Member Functions

 __init__ (self, parent=None)
 Initialise the IntegerValidator object.
 
 validate (self, str input, int pos)
 Check that the input string conforms to a valid or plausible integer value.
 
 fixup (self, str input)
 Adjusts the input string to the nearest likely valid integer value.
 
 get_minimum (self)
 Getter returns the minimum value accepted by the validator.
 
 set_minimum (self, int value)
 Setter for the minimum value accepted by the validator.
 
 get_maximum (self)
 Getter returns the maximum value accepted by the validator.
 
 set_maximum (self, int value)
 Setter for the maximum value accepted by the validator.
 

Static Public Attributes

 minimum
 
 maximum
 

Protected Attributes

int _minimum = 0
 
int _maximum = 100
 

Detailed Description

An input text validator that accepts integer values.

The validation is performed for conversion to Python int types, which are unbounded. Therefore technically any size integer could be handled.

Constructor & Destructor Documentation

◆ __init__()

gui.integer_edit.IntegerValidator.__init__ ( self,
parent = None )

Initialise the IntegerValidator object.

Parameters
parentThe optional parent Qt object of the new instance.

Member Function Documentation

◆ fixup()

gui.integer_edit.IntegerValidator.fixup ( self,
str input )

Adjusts the input string to the nearest likely valid integer value.

Parameters
inputThe input string to adjust.
Returns
Corrected valid value as a string or the original if it was already valid.

◆ get_maximum()

gui.integer_edit.IntegerValidator.get_maximum ( self)

Getter returns the maximum value accepted by the validator.

All values below and including the maximum are accepted as valid.

◆ get_minimum()

gui.integer_edit.IntegerValidator.get_minimum ( self)

Getter returns the minimum value accepted by the validator.

All values above and including the minimum are accepted as valid.

◆ set_maximum()

gui.integer_edit.IntegerValidator.set_maximum ( self,
int value )

Setter for the maximum value accepted by the validator.

All values below and including the maximum are accepted as valid.

Parameters
valueThe new maximum value allowed.

◆ set_minimum()

gui.integer_edit.IntegerValidator.set_minimum ( self,
int value )

Setter for the minimum value accepted by the validator.

All values above and including the minimum are accepted as valid.

Parameters
valueThe new minimum value allowed.

◆ validate()

gui.integer_edit.IntegerValidator.validate ( self,
str input,
int pos )

Check that the input string conforms to a valid or plausible integer value.

There is also a bounds check that will check that the value falls between the minimum and maximum (inclusive) set for the validator.

Parameters
inputThe input string to check.
posThe position of the cursor within the input string.
Returns
Tuple containing the validity flag, the input and pos arguments.

Member Data Documentation

◆ _maximum

gui.integer_edit.IntegerValidator._maximum = 100
protected

◆ _minimum

gui.integer_edit.IntegerValidator._minimum = 0
protected

◆ maximum

gui.integer_edit.IntegerValidator.maximum
static
Initial value:
= Property(
type=int,
fget=get_maximum,
fset=set_maximum,
doc="The maximum value allowed.",
)

◆ minimum

gui.integer_edit.IntegerValidator.minimum
static
Initial value:
= Property(
type=int,
fget=get_minimum,
fset=set_minimum,
doc="The minimum value allowed.",
)

The documentation for this class was generated from the following file: