示例#1
0
def _is_value_valid(value: float, validator: QValidator = None) -> bool:
    try:
        value = float(value)
    except ValueError as ex:
        return False
    else:
        if validator is None:
            return True
        else:
            bottom = validator.bottom()
            top = validator.top()

            if bottom <= value <= top:
                return True
            else:
                return False
示例#2
0
 def __init__(self, parent=None):
     QValidator.__init__(self, parent)
     self.parser = Parser()
示例#3
0
 def __init__(self, used_name, parent=None):
     QValidator.__init__(self, parent)
     self.used_name = used_name
示例#4
0
    def __init__(self, itemList, editor, depend, parent):
        QValidator.__init__(self, parent)

        self.itemList = itemList
        self.editor = editor
        self.depend = depend
 def __init__(self, m, n):
     QValidator.__init__(self)
 def __init__(self, minimum=None, maximum=None):
     QValidator.__init__(self)
     self.minimum = minimum
     self.maximum = maximum
示例#7
0
文件: validators.py 项目: kdjvd/Labs
 def __init__(self, lineeditor):
     QValidator.__init__(self)
     self.min = float("-inf")
     self.max = float("inf")
     self.lineeditor = lineeditor
示例#8
0
 def __init__(self, vt, vo):
     QValidator.__init__(self, vo)
     self.vt = vt
示例#9
0
 def __init__(self, min, max, parent):
     QValidator.__init__(self, parent)
     self.s = set(
         ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', ',', ''])