QNodeEditor.entries.text_box.TextBoxEntry#

class QNodeEditor.entries.text_box.TextBoxEntry(name: str, entry_type: int = 1, value: str = '', max_length: int = 32767, show_clear_button: bool = False, input_mask: str = '', completer: ~PyQt5.QtWidgets.QCompleter | None = None, validator: ~PyQt5.QtGui.QValidator | None = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, **kwargs)#

Bases: Entry

Entry housing a text box with a value and name

The text box is a string input. The user can click on the text box to type in text.

Examples

entry = TextBoxEntry('Some entry', value='Some text')

node = MyNode()
node.add_entry(entry)

The Node class also contains helper methods to create text box entries.

Properties

Methods

__init__

Create a new text box entry.

check_visible

Hide/show the text box depending on the input connections.

load

Load the value of the text box from an entry state.

save

Save the value of the text box in the entry state.

__init__(name: str, entry_type: int = 1, value: str = '', max_length: int = 32767, show_clear_button: bool = False, input_mask: str = '', completer: ~PyQt5.QtWidgets.QCompleter | None = None, validator: ~PyQt5.QtGui.QValidator | None = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, **kwargs)#

Create a new text box entry.

Parameters:
  • name (str) – Name of the entry

  • entry_type (int) – The type of the entry (TYPE_STATIC, TYPE_INPUT, or TYPE_OUTPUT)

  • value (str) – Initial value of the entry

  • theme (Type[Theme], optional) – Theme for the entry (default: DarkTheme)

check_visible() None#

Hide/show the text box depending on the input connections.

If the entry is an input and an edge is connected, hide the text box and only show a label. Otherwise, show the text box

Return type:

None

load(state: dict) bool#

Load the value of the text box from an entry state.

Parameters:

state (dict) – Entry state

Returns:

Whether setting state succeeded

Return type:

bool

save() dict#

Save the value of the text box in the entry state.

Return type:

State of the text box