QNodeEditor.entries.labeled.LabeledEntry#

class QNodeEditor.entries.labeled.LabeledEntry(*args, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, **kwargs)#

Bases: Entry

Entry housing a label displaying the name of the entry.

The entry is left-aligned for static and input entries, but right-aligned for output entries.

Examples

Example usage:

entry = LabeledEntry('Some entry')

node = MyNode()
node.add_entry(entry)

The Node class also contains helper methods to create labeled entries:

node = MyNode()

node.add_label_entry('Some entry', Entry.TYPE_INPUT)
node.add_label_input('Some input')
node.add_label_output('Some output')
label#

Label widget with custom theming

Type:

Label

Properties

Methods

__init__

Create a new labeled entry.

on_name_change

Update the label text when the entry name changes.

on_resize

Update the label text when the entry width changes (affects truncation).

on_theme_change

Update the label theme when the entry theme changes.

__init__(*args, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>, **kwargs)#

Create a new labeled entry.

Parameters:

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

on_name_change(name: str) None#

Update the label text when the entry name changes.

The name is truncated if necessary to fit into the available with.

Parameters:

name (str) – New entry name

Return type:

None

on_resize(*_) None#

Update the label text when the entry width changes (affects truncation).

Return type:

None

on_theme_change() None#

Update the label theme when the entry theme changes.

Return type:

None