Skip to content

IntLineEdit

Qt Base Class: QLineEdit

Signature: QLineEdit(self, arg__1: str, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None QLineEdit(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None

Base classes

Name Children Inherits
LineEdit
prettyqt.widgets.lineedit

⋔ Inheritance diagram

graph TD
  1473367082352["custom_widgets.IntLineEdit"]
  1473293691168["widgets.LineEdit"]
  1473293688240["widgets.WidgetMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473245548480["gui.PaintDeviceMixin"]
  1473290611536["QtWidgets.QLineEdit"]
  1473290849680["QtWidgets.QWidget"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473300082368["QtGui.QPaintDevice"]
  1473293691168 --> 1473367082352
  1473293688240 --> 1473293691168
  1473299815024 --> 1473293688240
  140713234304496 --> 1473299815024
  1473245548480 --> 1473293688240
  140713234304496 --> 1473245548480
  1473290611536 --> 1473293691168
  1473290849680 --> 1473290611536
  1473288842240 --> 1473290849680
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473300082368 --> 1473290849680
  1473291690208 --> 1473300082368

🛈 DocStrings

Bases: LineEdit

Source code in prettyqt\custom_widgets\editors\lineedits.py
class IntLineEdit(widgets.LineEdit):
    value_changed = core.Signal(int)

    def __init__(self, *args, object_name: str = "int_lineedit", **kwargs):
        super().__init__(*args, object_name=object_name, **kwargs)
        self.set_validator("integer", bottom=0, top=1000000000)

    def get_value(self) -> int:
        val = super().get_value()
        return int(val) if val and val.isnumeric() else 0

    def set_value(self, value: int | str):
        super().set_value(str(value))

    value = core.Property(
        int,
        get_value,
        set_value,
        doc="Current Value as integer",
    )

⌗ Property table

Qt Property Type Doc
objectName QString
modal bool
windowModality Qt::WindowModality
enabled bool
geometry QRect
frameGeometry QRect
normalGeometry QRect
x int
y int
pos QPoint
frameSize QSize
size QSize
width int
height int
rect QRect
childrenRect QRect
childrenRegion QRegion
sizePolicy QSizePolicy
minimumSize QSize
maximumSize QSize
minimumWidth int
minimumHeight int
maximumWidth int
maximumHeight int
sizeIncrement QSize
baseSize QSize
palette QPalette
font QFont
cursor QCursor
mouseTracking bool
tabletTracking bool
isActiveWindow bool
focusPolicy Qt::FocusPolicy
focus bool
contextMenuPolicy Qt::ContextMenuPolicy
updatesEnabled bool
visible bool
minimized bool
maximized bool
fullScreen bool
sizeHint QSize
minimumSizeHint QSize
acceptDrops bool
windowTitle QString
windowIcon QIcon
windowIconText QString
windowOpacity double
windowModified bool
toolTip QString
toolTipDuration int
statusTip QString
whatsThis QString
accessibleName QString
accessibleDescription QString
layoutDirection Qt::LayoutDirection
autoFillBackground bool
styleSheet QString
locale QLocale
windowFilePath QString
inputMethodHints QFlags
inputMask QString
text QString
maxLength int
frame bool
echoMode QLineEdit::EchoMode
displayText QString
cursorPosition int
alignment QFlags
modified bool
hasSelectedText bool
selectedText QString
dragEnabled bool
readOnly bool
undoAvailable bool
redoAvailable bool
acceptableInput bool
placeholderText QString
cursorMoveStyle Qt::CursorMoveStyle
clearButtonEnabled bool
value int Current Value as integer