The PySide.QtGui.QDoubleValidator class provides range checking of floating-point numbers.
PySide.QtGui.QDoubleValidator provides an upper bound, a lower bound, and a limit on the number of digits after the decimal point. It does not provide a PySide.QtGui.QValidator.fixup() function.
You can set the acceptable range in one call with PySide.QtGui.QDoubleValidator.setRange() , or with PySide.QtGui.QDoubleValidator.setBottom() and PySide.QtGui.QDoubleValidator.setTop() . Set the number of decimal places with PySide.QtGui.QDoubleValidator.setDecimals() . The PySide.QtGui.QDoubleValidator.validate() function returns the validation state.
PySide.QtGui.QDoubleValidator uses its PySide.QtGui.QValidator.locale() to interpret the number. For example, in the German locale, “1,234” will be accepted as the fractional number 1.234. In Arabic locales, PySide.QtGui.QDoubleValidator will accept Arabic digits.
In addition, PySide.QtGui.QDoubleValidator is always guaranteed to accept a number formatted according to the “C” locale. PySide.QtGui.QDoubleValidator will not accept numbers with thousand-separators.
See also
PySide.QtGui.QIntValidator PySide.QtGui.QRegExpValidator Line Edits Example
Parameters: |
|
---|
Constructs a validator object with a parent object that accepts any double.
Constructs a validator object with a parent object. This validator will accept doubles from bottom to top inclusive, with up to decimals digits after the decimal point.
This enum defines the allowed notations for entering a double.
Constant | Description |
---|---|
QDoubleValidator.StandardNotation | The string is written as a standard number (i.e. 0.015). |
QDoubleValidator.ScientificNotation | The string is written in scientific form. It may have an exponent part(i.e. 1.5E-2). |
Return type: | PySide.QtCore.double |
---|
This property holds the validator’s minimum acceptable value.
By default, this property contains a value of -infinity.
Return type: | PySide.QtCore.int |
---|
This property holds the validator’s maximum number of digits after the decimal point.
By default, this property contains a value of 1000.
Return type: | PySide.QtGui.QDoubleValidator.Notation |
---|
This property holds the notation of how a string can describe a number.
By default, this property is set to ScientificNotation .
See also
QDoubleValidator.Notation
Parameters: | arg__1 – PySide.QtCore.double |
---|
This property holds the validator’s minimum acceptable value.
By default, this property contains a value of -infinity.
Parameters: | arg__1 – PySide.QtCore.int |
---|
This property holds the validator’s maximum number of digits after the decimal point.
By default, this property contains a value of 1000.
Parameters: | arg__1 – PySide.QtGui.QDoubleValidator.Notation |
---|
This property holds the notation of how a string can describe a number.
By default, this property is set to ScientificNotation .
See also
QDoubleValidator.Notation
Parameters: |
|
---|
Sets the validator to accept doubles from minimum to maximum inclusive, with at most decimals digits after the decimal point.
Parameters: | arg__1 – PySide.QtCore.double |
---|
This property holds the validator’s maximum acceptable value.
By default, this property contains a value of infinity.
Return type: | PySide.QtCore.double |
---|
This property holds the validator’s maximum acceptable value.
By default, this property contains a value of infinity.