Skip to content

ValidatorMixin

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object

Subclasses

Class Module Description
Validator prettyqt.gui.validator
RegularExpressionValidator prettyqt.gui.regularexpressionvalidator
IntValidator prettyqt.gui.intvalidator
DoubleValidator prettyqt.gui.doublevalidator

⋔ Inheritance diagram

graph TD
  1473245536768["gui.ValidatorMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473299815024 --> 1473245536768
  140713234304496 --> 1473299815024

🛈 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