spark.graph_editor.widgets.attributes#

Attributes#

Classes#

QControlFlags

Support for integer-based Flags

QAttrControls

QAttribute

Base QWidget class for the graph editor attributes.

QConfigBody

QWidget for the body of configuration object.

TypeParser

WidgetParserMetadata

WidgetParser

Module Contents#

class spark.graph_editor.widgets.attributes.QControlFlags[source]#

Bases: enum.IntFlag

Support for integer-based Flags

Initialize self. See help(type(self)) for accurate signature.

SHOW = 8[source]#
INTERACTIVE = 4[source]#
EMPTY_SPACE = 2[source]#
ACTIVE = 1[source]#
SHOW_INTERACTIVE = 12[source]#
SHOW_INTERACTIVE_ACTIVE = 13[source]#
SHOW_ACTIVE = 9[source]#
ALL = 15[source]#
class spark.graph_editor.widgets.attributes.QAttrControls(on_initializer_toggled_callback, on_inheritance_toggled_callback, warning_flags, inheritance_flags, initializer_flags, **kwargs)[source]#

Bases: PySide6.QtWidgets.QWidget

Parameters:
on_update[source]#
class spark.graph_editor.widgets.attributes.QAttribute(attr_label, attr_value, attr_widget, attr_init_mandatory=False, attr_metadata=None, warning_flags=QControlFlags.SHOW_INTERACTIVE, inheritance_flags=QControlFlags.EMPTY_SPACE, initializer_flags=QControlFlags.EMPTY_SPACE, ref_post_callback_stack=None, is_initializer_attr=False, **kwargs)[source]#

Bases: PySide6.QtWidgets.QWidget

Base QWidget class for the graph editor attributes.

Parameters:
on_initializer_toggled[source]#
on_inheritance_toggled[source]#
on_field_update[source]#
on_size_change[source]#
attr_label[source]#
config_widget = None[source]#
init_config = None[source]#
main_row[source]#
control_widgets[source]#
secondary_row[source]#
set_initializer_status(state)[source]#

Sets the error status of widget.

Parameters:

state (bool)

Return type:

None

set_inheritance_status(state)[source]#

Sets the error status of widget.

Parameters:

state (spark.graph_editor.widgets.checkbox.InheritStatus)

Return type:

None

set_error_status(messages)[source]#

Sets the error status of widget.

Parameters:

messages (list[str])

Return type:

None

set_value(value)[source]#

Set the widget value.

Parameters:

value (Any)

Return type:

Any

get_value()[source]#

Get the widget value.

Return type:

Any

class spark.graph_editor.widgets.attributes.QConfigBody(config, is_initializer, config_path=None, ref_widgets_map=None, ref_post_callback_stack=None, inheritance_tree=None, on_inheritance_toggle=None, **kwargs)[source]#

Bases: PySide6.QtWidgets.QWidget

QWidget for the body of configuration object.

Parameters:
on_error_detected[source]#
on_size_change[source]#
on_update[source]#
config[source]#
get_value()[source]#
Return type:

spark.core.config.BaseSparkConfig

class spark.graph_editor.widgets.attributes.TypeParser[source]#
GENERIC_TYPES: dict[str, type][source]#
SPECIAL_TYPES: dict[str, type][source]#
CONTAINER_TYPES: re.Pattern[source]#
typify(raw_types)[source]#
Parameters:

raw_types (type | str | Iterable[type | str])

Return type:

tuple[type, Ellipsis]

class spark.graph_editor.widgets.attributes.WidgetParserMetadata[source]#
allows_init: bool[source]#
requires_init: bool[source]#
allows_inheritance: bool[source]#
missing: bool[source]#
second_option: type[PySide6.QtWidgets.QWidget][source]#
class spark.graph_editor.widgets.attributes.WidgetParser[source]#
WIDGET_TYPE_MAP[source]#
WIDGET_PRIORITY_MAP[source]#
get_possible_widgets(attr_type)[source]#

Maps an argument type to a corresponding type of possible widgets classes. Returns an ordered list of widgets and metadata to format the inspector.

Parameters:

attr_type (tuple[type, Ellipsis])

Return type:

tuple[list[type[PySide6.QtWidgets.QWidget]], WidgetParserMetadata]

get_possible_widgets_raw(raw_types)[source]#

Maps an argument raw type to a corresponding type of possible widgets classes. Returns an ordered list of widgets and metadata to format the inspector.

Parameters:

raw_types (type | str | Iterable[type | str])

Return type:

tuple[list[type[PySide6.QtWidgets.QWidget]], WidgetParserMetadata]

get_widget(attr_type)[source]#

Maps an argument type to a corresponding widget class, according to the priority list. Returns the best widget fit and metadata to format the inspector.

Parameters:

attr_type (tuple[type, Ellipsis])

Return type:

tuple[type[PySide6.QtWidgets.QWidget], WidgetParserMetadata]

get_widget_raw(raw_types)[source]#

Maps an argument raw type to a corresponding widget class, according to the priority list. Returns the best widget fit and metadata to format the inspector.

Parameters:

raw_types (type | str | Iterable[type | str])

Return type:

tuple[type[PySide6.QtWidgets.QWidget], WidgetParserMetadata]

spark.graph_editor.widgets.attributes.TYPE_PARSER[source]#
spark.graph_editor.widgets.attributes.WIDGET_PARSER[source]#