Skip to content

Commit

Permalink
Add NodeRole::WidgetEmbeddable for all switches
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoth committed Feb 20, 2023
1 parent 16f23b9 commit c6a4b82
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/dynamic_ports/DynamicPortsModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ QVariant DynamicPortsModel::nodeData(NodeId nodeId, NodeRole role) const
result = _nodePortCounts[nodeId].out;
break;

case NodeRole::WidgetEmbeddable:
result = true;
break;

case NodeRole::Widget: {
result = QVariant::fromValue(widget(nodeId));
break;
Expand Down Expand Up @@ -194,6 +198,9 @@ bool DynamicPortsModel::setNodeData(NodeId nodeId, NodeRole role, QVariant value
widget(nodeId)->populateButtons(PortType::Out, value.toUInt());
break;

case NodeRole::WidgetEmbeddable:
break;

case NodeRole::Widget:
break;
}
Expand Down
7 changes: 7 additions & 0 deletions examples/simple_graph_model/SimpleGraphModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ QVariant SimpleGraphModel::nodeData(NodeId nodeId, NodeRole role) const
result = 1u;
break;

case NodeRole::WidgetEmbeddable:
result = true;
break;

case NodeRole::Widget:
result = QVariant();
break;
Expand Down Expand Up @@ -167,6 +171,9 @@ bool SimpleGraphModel::setNodeData(NodeId nodeId, NodeRole role, QVariant value)
case NodeRole::OutPortCount:
break;

case NodeRole::WidgetEmbeddable:
break;

case NodeRole::Widget:
break;
}
Expand Down
7 changes: 7 additions & 0 deletions examples/vertical_layout/SimpleGraphModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ QVariant SimpleGraphModel::nodeData(NodeId nodeId, NodeRole role) const
result = 3u;
break;

case NodeRole::WidgetEmbeddable:
result = true;
break;

case NodeRole::Widget:
result = QVariant();
break;
Expand Down Expand Up @@ -167,6 +171,9 @@ bool SimpleGraphModel::setNodeData(NodeId nodeId, NodeRole role, QVariant value)
case NodeRole::OutPortCount:
break;

case NodeRole::WidgetEmbeddable:
break;

case NodeRole::Widget:
break;
}
Expand Down

0 comments on commit c6a4b82

Please sign in to comment.