Skip to content

ValidatorMixin

Sub classes

Name Children Inherits
Validator
prettyqt.gui.validator
RegularExpressionValidator
prettyqt.gui.regularexpressionvalidator
Used to check a string against a regular expression.
    IntValidator
    prettyqt.gui.intvalidator
    Validator that ensures a string contains a integer within a specified range.
      DoubleValidator
      prettyqt.gui.doublevalidator
      Range checking of floating-point numbers.

        Base classes

        Name Children Inherits
        ObjectMixin
        prettyqt.core.object

        ⋔ Inheritance diagram

        graph TD
          1804432572["gui.ValidatorMixin"]
          3227531497["core.ObjectMixin"]
          2751680898["builtins.object"]
          3227531497 --> 1804432572
          2751680898 --> 3227531497

        🛈 DocStrings

        Bases: ObjectMixin

        Source code in prettyqt/gui/validator.py
        class ValidatorMixin(core.ObjectMixin):
            def __repr__(self):
                return get_repr(self)
        
            def __and__(self, other: Validator):
                from prettyqt import validators
        
                return validators.AndValidator([self, other])
        
            def __or__(self, other: Validator):
                from prettyqt import validators
        
                return validators.OrValidator([self, other])
        
            def is_valid_value(self, value: str, pos: int = 0) -> bool:
                val = self.validate(value, pos)
                return val[0] == self.State.Acceptable  # type: ignore
        

        :fa-brands-github: Show source on GitHub