Exemple #1
0
    def __init__(self, max_bytes=-1):
        QValidator.__init__(self)

        self.max_bytes = max_bytes

        if max_bytes == 0:
            self.re_acceptable = QRegExp('')
            self.re_intermediate = QRegExp('')
        elif max_bytes > 0:
            self.re_acceptable = QRegExp('([0-9A-Fa-f]{2} ){0,%d}[0-9A-Fa-f]{2}' % (max_bytes - 1))
            self.re_intermediate = QRegExp('[ ]*|([ ]*[0-9A-Fa-f][ ]*){1,%d}' % (max_bytes * 2))
        else:
            self.re_acceptable = QRegExp('([0-9A-Fa-f]{2} )*[0-9A-Fa-f]{2}')
            self.re_intermediate = QRegExp('[ ]*|([ ]*[0-9A-Fa-f][ ]*)+')
Exemple #2
0
    def __init__(self, max_bytes=-1):
        QValidator.__init__(self)

        self.max_bytes = max_bytes

        if max_bytes == 0:
            self.re_acceptable = QRegExp('')
            self.re_intermediate = QRegExp('')
        elif max_bytes > 0:
            self.re_acceptable = QRegExp(
                '([0-9A-Fa-f]{2} ){0,%d}[0-9A-Fa-f]{2}' % (max_bytes - 1))
            self.re_intermediate = QRegExp('[ ]*|([ ]*[0-9A-Fa-f][ ]*){1,%d}' %
                                           (max_bytes * 2))
        else:
            self.re_acceptable = QRegExp('([0-9A-Fa-f]{2} )*[0-9A-Fa-f]{2}')
            self.re_intermediate = QRegExp('[ ]*|([ ]*[0-9A-Fa-f][ ]*)+')
Exemple #3
0
 def __init__(self, widget):
     QValidator.__init__(self, widget)
     self.model = widget.model()
Exemple #4
0
 def __init__(self, codec):
     QValidator.__init__(self)
     self.codec = codec
Exemple #5
0
 def __init__(self):
     QValidator.__init__(self)
     self._qvalidator = QDoubleValidator()
 def __init__(self):
     QValidator.__init__(self)
Exemple #7
0
 def __init__(self):
     QValidator.__init__(self)
Exemple #8
0
 def __init__(self, formatter, codec):
     QValidator.__init__(self)
     self.formatter = formatter
     self.codec = codec