QNodeEditor.serialise.serialise.Serializable#

class QNodeEditor.serialise.serialise.Serializable#

Bases: object

Base for serializable objects.

This class is abstract and cannot be used by itself. Various node editor classes inherit from this class.

Methods

get_state

Get the state of this object as a (JSON-safe) dictionary

set_state

Set the state of this object from a state dictionary.

__init__()#
abstract get_state() dict#

Get the state of this object as a (JSON-safe) dictionary

Returns:

JSON-safe dictionary representing object state

Return type:

dict

abstract set_state(state: dict, restore_id: bool = True) bool#

Set the state of this object from a state dictionary.

Parameters:
  • state (dict) – Dictionary representation of the desired object state

  • restore_id (bool, optional) – Whether to restore the internal IDs of the entry sockets (used to reconnect saved edges)

Returns:

Whether setting the object state succeeded

Return type:

bool