QNodeEditor.widgets.text_box.TextBox#
- class QNodeEditor.widgets.text_box.TextBox(name: str = '', parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#
Bases:
QWidgetWidget with a string value that allows for text inputs.
The text box by default is a line edit. The widget can switch to a label displaying the widget name instead (used when an edge is connected to an entry with this widget).
Properties
Get or set whether the completer that is used in the QLineEdit
editing(bool)Signal that emits when the user starts/stops editing the line edit
Get or set whether the input mask that is used in the QLineEdit
Get or set whether the maximum length that is used in the QLineEdit
Get or set the text box name
Get or set whether the line edit should show a clear all button when not empty.
Get or set the text box theme
Get or set whether the validator that is used in the QLineEdit
Get or set the current value.
value_changed(QString)Signal that emits the box value if it changed
Methods
Create a new text box.
Create the layout of the text box with a stacked layout.
Change the line edit style when the mouse hover enters it.
Change the line edit style when the mouse hover leaves it.
Hide/show the text box and hide/show only the label instead.
Update the editing signal of the text box when focus enters/leaves the line edit.
Update the style of the line edit based on the current properties.
- __init__(name: str = '', parent: ~PyQt5.QtWidgets.QWidget = None, theme: ~typing.Type[~QNodeEditor.themes.theme.Theme] = <class 'QNodeEditor.themes.dark.DarkTheme'>)#
Create a new text box.
- create_layout() None#
Create the layout of the text box with a stacked layout.
The first page of the stacked layout contains the line edit, the second page contains only a label. These can be switched between when an entry is connected to another node.
- Return type:
None
- enterEvent(_) None#
Change the line edit style when the mouse hover enters it.
- Return type:
None
- leaveEvent(_) None#
Change the line edit style when the mouse hover leaves it.
- Return type:
None
- set_label_only(label_only: bool) None#
Hide/show the text box and hide/show only the label instead.
- Parameters:
label_only (bool) – Whether to only show the name label
- Return type:
None
- update_editing_signal(has_focus: bool) None#
Update the editing signal of the text box when focus enters/leaves the line edit.
- Parameters:
has_focus (bool) – Whether the line edit has focus
- Return type:
None
- update_style() None#
Update the style of the line edit based on the current properties.
- Return type:
None
- property completer: QCompleter | None#
Get or set whether the completer that is used in the QLineEdit
- property input_mask: str#
Get or set whether the input mask that is used in the QLineEdit
- property max_length: int#
Get or set whether the maximum length that is used in the QLineEdit
- property name: str#
Get or set the text box name
- property show_clear_button: bool#
Get or set whether the line edit should show a clear all button when not empty.
- property validator: QValidator | None#
Get or set whether the validator that is used in the QLineEdit
- property value: str#
Get or set the current value.