WidgetManager (widgetmanager)

class orangecanvas.scheme.widgetmanager.WidgetManager(*args, **kwargs)[source]

Bases: PyQt5.QtCore.QObject

WidgetManager class is responsible for creation, tracking and deletion of UI elements constituting an interactive workflow.

It does so by reacting to changes in the underlying workflow model, creating and destroying the components when needed.

This is an abstract class, subclassed MUST reimplement at least create_widget_for_node() and delete_widget_for_node().

The widgets created with create_widget_for_node() will automatically receive dispatched events:

See also

Scheme.add_link(), Scheme.remove_link(), Scheme.runtime_env(), NodeEvent, LinkEvent

widget_for_node_added(SchemeNode, QWidget)

A new QWidget was created and added by the manager.

Signal emitted when a QWidget was created and added by the manager.

widget_for_node_removed(SchemeNode, QWidget)

A QWidget was removed, hidden and will be deleted when appropriate.

Signal emitted when a QWidget was removed and will be deleted.

class CreationPolicy(value)[source]

Bases: enum.Enum

Widget Creation Policy.

Normal = 'Normal'

Widgets are scheduled to be created from the event loop, or when first accessed with widget_for_node

Immediate = 'Immediate'

Widgets are created immediately when a node is added to the workflow model.

OnDemand = 'OnDemand'

Widgets are created only when first accessed with widget_for_node (e.g. when activated in the view).


Set the workflow.


Set the workflow.


Set the widget creation policy.


Return the current widget creation policy.


Create and initialize a widget for node.

This is an abstract method. Subclasses must reimplemented it.

delete_widget_for_node(node, widget)[source]

Remove and delete widget for node.

This is an abstract method. Subclasses must reimplemented it.


Return the node for widget.


Return the widget for node.


Ensure that the widget for node is created.

activate_widget_for_node(node, widget)[source]

Activate the widget for node (show and raise above other)


Raise all current visible widgets to the front.

The widgets will be stacked by activation order.


Set Float Widgets on Top flag on all widgets.


Save current open window arrangement.


Restore the window state.

save_widget_geometry(node, widget)[source]

Save and return the current geometry and state for node.

restore_widget_geometry(node, widget, state)[source]

Restore the widget geometry and state for node.

Return True if the geometry was restored successfully.

The default implementation does nothing.

eventFilter(self, QObject, QEvent) bool[source]

Return a list of extra actions that can be inserted into context menu in the workflow editor.

Subclasses can reimplement this method to extend the default context menu.


node (SchemeNode) – The node for which the context menu is requested.


actions – Actions that are appended to the default menu.

Return type