QNodeEditor.clipboard.clipboard.Clipboard#
- class QNodeEditor.clipboard.clipboard.Clipboard(scene: NodeScene)#
Bases:
objectClass that handles cutting/copying/pasting for node scenes.
This class contains methods that are called when items in a node scene are copied, pasted, or cut.
Methods
Create a new clipboard manager.
Add items to the scene from a state dictionary.
Copy the state of the selected scene items to the clipboard
Copy the state of the selected scene items to the clipboard, then remove them.
Get the state of the selected scene items as a (JSON-safe) dictionary.
Paste items into the scene from a clipboard state.
- __init__(scene: NodeScene)#
Create a new clipboard manager.
- Parameters:
scene (
NodeScene) – Node scene this clipboard manager is for
- add_state(state: dict) None#
Add items to the scene from a state dictionary.
- Parameters:
state (dict) – Dictionary containing desired state of items to add
- Return type:
None
- copy() None#
Copy the state of the selected scene items to the clipboard
- Return type:
None
- cut() None#
Copy the state of the selected scene items to the clipboard, then remove them.
- Return type:
None
- get_selected_state(remove_after: bool = False) dict#
Get the state of the selected scene items as a (JSON-safe) dictionary.
- Parameters:
remove_after (bool) – Whether to remove the selected items after getting their state
- Returns:
JSON-safe dictionary representing selected scene items state
- Return type:
dict
- paste() None#
Paste items into the scene from a clipboard state.
- Return type:
None