Skip to content

IntValidator

Qt Base Class: QIntValidator

Signature: QIntValidator(self, bottom: int, top: int, parent: Optional[PySide6.QtCore.QObject] = None) -> None QIntValidator(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ValidatorMixin
prettyqt.gui.validator
QIntValidator
PySide6.QtGui
QIntValidator(self, bottom: int, top: int, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473245582640["gui.IntValidator"]
  1473245536768["gui.ValidatorMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473289213472["QtGui.QIntValidator"]
  1473289208592["QtGui.QValidator"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473245536768 --> 1473245582640
  1473299815024 --> 1473245536768
  140713234304496 --> 1473299815024
  1473289213472 --> 1473245582640
  1473289208592 --> 1473289213472
  1473288842240 --> 1473289208592
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ValidatorMixin, QIntValidator

Validator that ensures a string contains a integer within a specified range.

Source code in prettyqt\gui\intvalidator.py
class IntValidator(gui.ValidatorMixin, gui.QIntValidator):
    """Validator that ensures a string contains a integer within a specified range."""

    ID = "integer_classic"

    def __repr__(self):
        return get_repr(self, self.bottom(), self.top())

    def __getstate__(self):
        return dict(bottom=self.bottom(), top=self.top())

    def __reduce__(self):
        return type(self), (self.bottom(), self.top()), None

    def __eq__(self, other: object):
        return (
            self.bottom() == other.bottom() and self.top() == other.top()
            if isinstance(other, type(self))
            else False
        )

    def set_range(self, lower: int | None, upper: int | None):
        if lower is None:
            lower = -MAX_VAL
        if upper is None:
            upper = MAX_VAL
        self.setRange(lower, upper)

⌗ Property table

Qt Property Type Doc
objectName QString
bottom int
top int