|
Maki
Formally verfied low-code orchestration
|
Tree widget used to display and manage flows and nodes in the system view. More...
#include <system_menu.h>
Signals | |
| void | nodeFocused (const QString &flowId, const QString &nodeId) |
| Emitted when a node should be focused in the editor. | |
| void | nodeRemoved (const QString &flowId, const QString &nodeId) |
| Emitted when a node should be removed. | |
| void | flowSelected (const QString &flowId, const QString &nodeId) |
| Emitted when a flow is selected. | |
| void | flowRemoved (const QString &flowId, const QString &nodeId) |
| Emitted when a flow should be removed. | |
| void | flowRenamed (const QString &flowId, const QString &nodeId) |
| Emitted when a flow should be renamed. | |
Public Member Functions | |
| SystemMenu (QWidget *parent) | |
| Constructs the system menu widget. | |
| VoidResult | onNodeAdded (const QString &flowId, NodeItem *node, const Types::LibraryTypes canvasType) |
| Handles the addition of a node to a flow. | |
| VoidResult | onNodeRemoved (const QString &flowId, const QString &nodeId, const QString &parentId) |
| Handles the removal of a node from a flow. | |
| VoidResult | onNodeModified (const QString &flowId, NodeItem *node) |
| Handles modifications to an existing node. | |
| VoidResult | onNodeSelected (const QString &flowId, NodeItem *node, bool selected) |
| Handles selection state changes for a node. | |
| VoidResult | onFlowAdded (Flow *flow, NodeItem *node) |
| Handles the addition of a flow to the menu. | |
| VoidResult | onFlowRemoved (const QString &flowId, const QString &nodeId) |
| Handles the removal of a flow from the menu. | |
Private Types | |
| enum | Roles { ToplevelRole = 0 , Capabilities , SubTasks , Flows , PipelineRoot , Pipeline , ComponentRole , FlowRole , NodeRole , PipelineRole } |
| Identifies the semantic role of a tree item. More... | |
Private Slots | |
| void | showContextMenu (const QPoint &pos) |
| Shows the context menu at the given position. | |
| void | onItemClicked (QTreeWidgetItem *item, int) |
| Handles clicks on tree items. | |
Private Member Functions | |
| VoidResult | addRootNode (NodeItem *node) |
| Adds a root node to the menu. | |
| VoidResult | addLeafNode (NodeItem *node) |
| Adds a leaf node to the menu. | |
| void | populateItem (QTreeWidgetItem *item, const QIcon &icon, const QString &name, const QString &type, const QString &data, const Roles role, const QString &canvas="") |
| Populates a tree widget item using data from a node. | |
| QTreeWidgetItem * | getItemById (const QString &id) const |
| Finds a tree item by its identifier. | |
| QTreeWidgetItem * | systemFlows () |
| Returns the root item containing system flows. | |
| QTreeWidgetItem * | componentFlows () |
| Returns the root item containing component flows. | |
| void | editFlow (QTreeWidgetItem *item) |
| Starts editing the given flow item. | |
| void | removeFlow (QTreeWidgetItem *item) |
| Removes the given flow item. | |
Tree widget used to display and manage flows and nodes in the system view.
This widget maintains a hierarchical representation of system-level and component-level flows, along with their nodes. It reacts to node and flow lifecycle events and exposes signals for user interactions such as focusing, selecting, renaming, and removing items.
|
private |
| SystemMenu::SystemMenu | ( | QWidget * | parent | ) |
Constructs the system menu widget.
| parent | The parent widget. |
|
private |
Adds a leaf node to the menu.
| node | The node to add. |
|
private |
Adds a root node to the menu.
| node | The node to add. |
|
private |
Returns the root item containing component flows.
|
private |
Starts editing the given flow item.
| item | The flow item to edit. |
|
signal |
Emitted when a flow should be removed.
| flowId | The identifier of the flow to remove. |
| nodeId | The identifier of the node associated with the flow. |
|
signal |
Emitted when a flow should be renamed.
| flowId | The identifier of the flow to rename. |
| nodeId | The identifier of the node associated with the flow. |
|
signal |
Emitted when a flow is selected.
| flowId | The identifier of the selected flow. |
| nodeId | The identifier of the node associated with the flow. |
|
private |
Finds a tree item by its identifier.
| id | The identifier to search for. |
|
signal |
Emitted when a node should be focused in the editor.
| flowId | The identifier of the flow containing the node. |
| nodeId | The identifier of the node to focus. |
|
signal |
Emitted when a node should be removed.
| flowId | The identifier of the flow containing the node. |
| nodeId | The identifier of the node to remove. |
Handles the addition of a flow to the menu.
| flow | The flow that was added. |
| node | The node associated with the flow. |
| VoidResult SystemMenu::onFlowRemoved | ( | const QString & | flowId, |
| const QString & | nodeId ) |
Handles the removal of a flow from the menu.
| flowId | The identifier of the flow to remove. |
| nodeId | The identifier of the node associated with the flow. |
|
privateslot |
Handles clicks on tree items.
| item | The item that was clicked. |
| The | clicked column index. |
| VoidResult SystemMenu::onNodeAdded | ( | const QString & | flowId, |
| NodeItem * | node, | ||
| const Types::LibraryTypes | canvasType ) |
Handles the addition of a node to a flow.
| flowId | The identifier of the flow to which the node belongs. |
| node | The node that was added. |
| VoidResult SystemMenu::onNodeModified | ( | const QString & | flowId, |
| NodeItem * | node ) |
Handles modifications to an existing node.
| flowId | The identifier of the flow containing the node. |
| node | The modified node. |
| VoidResult SystemMenu::onNodeRemoved | ( | const QString & | flowId, |
| const QString & | nodeId, | ||
| const QString & | parentId ) |
Handles the removal of a node from a flow.
| flowId | The identifier of the flow from which the node is removed. |
| nodeId | The identifier of the node to remove. |
| parentId | The identifier of the parent node, if applicable. |
| VoidResult SystemMenu::onNodeSelected | ( | const QString & | flowId, |
| NodeItem * | node, | ||
| bool | selected ) |
Handles selection state changes for a node.
| flowId | The identifier of the flow containing the node. |
| node | The node whose selection state changed. |
| selected | True if the node is selected, false otherwise. |
|
private |
Populates a tree widget item using data from a node.
| item | The tree item to populate. |
| node | The source node. |
|
private |
Removes the given flow item.
| item | The flow item to remove. |
|
privateslot |
Shows the context menu at the given position.
| pos | The position where the context menu should appear. |
|
private |
Returns the root item containing system flows.