edifice.TextInput#

class edifice.TextInput(text='', placeholder_text=None, on_change=None, on_edit_finish=None, completer=None, **kwargs)[source]#

Bases: QtWidgetElement[QLineEdit]

Basic widget for a one line text input.

../_images/textinput_button.png

TextInput on the left.#

Parameters:
  • text (str) – Initial text of the text input.

  • placeholder_text (Optional[str]) – “makes the line edit display a grayed-out placeholder text as long as the line edit is empty.” See placeHolderText

  • on_change (Optional[Callable[[str], Optional[Awaitable[None]]]]) – Event handler for when the value of the text input changes, but only when the user is editing the text, not when the text prop changes.

  • on_edit_finish (Optional[Callable[[], Optional[Awaitable[None]]]]) – Callback for the editingFinished event, when the Return or Enter key is pressed, or if the line edit loses focus and its contents have changed

  • completer (Union[tuple[CompletionMode, tuple[str, ...]], QCompleter, None]) –

    A suggested completion list based on the current text.

    This prop is a tuple of two elements:

    1. The CompletionMode which indicates how the completions should be presented to the user. UnfilteredPopupCompletion works best.

    2. A tuple of strings, the completion options. Calculate these based on the current text.

    Or optionally you can pass in an instance of a QCompleter (not recommended).

Methods

__init__([text, placeholder_text, ...])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Set the key of an Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.