QDoubleValidatorclass provides range checking of floating-point numbers. 更多 …
def
bottom
()
def
decimals
()
def
notation
()
def
setBottom
(arg__1)
def
setDecimals
(arg__1)
def
setNotation
(arg__1)
def
setTop
(arg__1)
def
top
()
def
bottomChanged
(bottom)
def
decimalsChanged
(decimals)
def
notationChanged
(notation)
def
topChanged
(top)
QDoubleValidatorprovides an upper bound, a lower bound, and a limit on the number of digits after the decimal point. It does not provide afixup()函数。You can set the acceptable range in one call with
setRange(), or withsetBottom()andsetTop(). Set the number of decimal places withsetDecimals()。validate()function returns the validation state.
QDoubleValidatoruses itslocale()to interpret the number. For example, in the German locale, “1,234” will be accepted as the fractional number 1.234. In Arabic locales,QDoubleValidatorwill accept Arabic digits.注意
NumberOptionsset on thelocale()also affect the way the number is interpreted. For example, sinceRejectGroupSeparatoris not set by default, the validator will accept group separators. It is thus recommended to usetoDouble()to obtain the numeric value.另请参阅
QIntValidatorQRegExpValidatortoDouble()行编辑范例
QDoubleValidator
(
[
parent=None
]
)
¶
QDoubleValidator(bottom, top, decimals[, parent=None])
- param parent
QObject- param bottom
double- param top
double- param decimals
int
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.
PySide2.QtGui.QDoubleValidator.
Notation
¶
This enum defines the allowed notations for entering a double.
|
常量 |
描述 |
|---|---|
|
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). |
PySide2.QtGui.QDoubleValidator.
bottom
(
)
¶
double
另请参阅
PySide2.QtGui.QDoubleValidator.
bottomChanged
(
bottom
)
¶
bottom
–
double
PySide2.QtGui.QDoubleValidator.
decimals
(
)
¶
int
另请参阅
PySide2.QtGui.QDoubleValidator.
decimalsChanged
(
decimals
)
¶
decimals
–
int
PySide2.QtGui.QDoubleValidator.
notation
(
)
¶
另请参阅
PySide2.QtGui.QDoubleValidator.
setDecimals
(
arg__1
)
¶
arg__1
–
int
另请参阅
PySide2.QtGui.QDoubleValidator.
setRange
(
bottom
,
top
[
,
decimals=0
]
)
¶
bottom
–
double
top
–
double
decimals
–
int
Sets the validator to accept doubles from
minimum
to
maximum
inclusive, with at most
decimals
digits after the decimal point.
PySide2.QtGui.QDoubleValidator.
topChanged
(
top
)
¶
top
–
double