def __init__(self, parent = None):
QDoubleSpinBox.__init__(self, parent)
self.saved_suffix = ''
#Let's use the locale decimal separator if it is different from the dot ('.')
local_decimal_separator = QLocale().decimalPoint()
if local_decimal_separator == '.':
local_decimal_separator = ''
self.lineEdit().setValidator(QRegExpValidator(QRegExp("-?[0-9]*[.{0}]?[0-9]*.*".format(local_decimal_separator)), self))
评论列表
文章目录