QmlNodeEditor
|
Signals | |
void | connectionAdded (int fromNodeId, int fromPortId, int toNodeId, int toPortId) |
void | connectionRemoved (int fromNodeId, int fromPortId, int toNodeId, int toPortId) |
void | nodeRemoved (int nodeId) |
void | nodePositionChanged (int nodeId, real x, real y) |
Public Member Functions | |
PortsDockRow | findConnectorRow (int nodeId, int portId) |
void | updateAllConnectionComponents () |
void | updateAllConnectionComponentsByNodeId (int nodeId) |
void | addConnectionComponent (ConnectionComponent from, ConnectionComponent to, bool removable) |
void | removeAllConnectionComponents () |
void | removeAllConnectionComponentsByNodeId (int nodeId) |
bool | removeConnectionComponent (ConnectionComponent from, ConnectionComponent to) |
void | setPortsState (string state, string filter) |
bool | checkFilterOnTags (string tags, string filter) |
Properties | |
var | model |
int | deleteKey |
QtObject | style |
Component | connectionShape |
Component | connectionComponent |
Dialog | nodeDeleteConfirmationDialog |
Dialog | connectionDeleteConfirmationDialog |
Component | nodeHeaderComponent |
Component | nodeTopContentComponent |
Component | nodeCenterContentComponent |
Component | nodeLeftPortComponent |
Component | nodeRightPortComponent |
Component | nodePortConnectorComponent |
Component | nodePortConnectorMouseArea |
Component | snapGridComponent |
ObjectModel | connectionsModel |
Node layout:
_______________________________________________________ | NodeView.nodeHeaderComponent | |-----------------------------------------------------| | NodeView.nodeTopContentComponent | | | |-----------------------------------------------------| o | left | | right | o <- NodeView.nodePortConnectorComponent o | ports | NodeView.nodeCenterContentComponent | ports | o o | dock | | dock | o | ^ | | | ------|------------------------------------------------ NodeView.nodeLeftPortComponent
Node.width = NodeView.nodeCenterContentComponent.width + NodeView.style.leftPortDockWidth + NodeView.style.rightPortDockWidth
Node.height = NodeView.nodeHeaderComponent.height + NodeView.nodeTopContentComponent.height + max(left ports dock, NodeView.nodeCenterContentComponent, right ports dock)
Definition at line 31 of file NodeView.qml.
void NodeView::addConnectionComponent | ( | ConnectionComponent | from, |
ConnectionComponent | to, | ||
bool | removable | ||
) |
Create ConnectionComponent and add it to the NodeView.connectionsModel
from | Connection from |
to | Connection to |
removable | Is connection removable |
bool NodeView::checkFilterOnTags | ( | string | tags, |
string | filter | ||
) |
Check the filter on the given tags
tags | Tags to check. If tags are not defined, then only undefined filter will match them. |
filter | Filter string to check. Undefined filter always match. |
|
signal |
Connection between two ports added.
|
signal |
Connection between two ports removed.
PortsDockRow NodeView::findConnectorRow | ( | int | nodeId, |
int | portId | ||
) |
Find the PortsDockRow by Node id and Port id.
nodeId | Node id |
portId | Port id |
|
signal |
|
signal |
Node removed
nodeId | removed Node id |
void NodeView::removeAllConnectionComponents | ( | ) |
Remove all ConnectionComponent from NodeView.connectionsModel and destroy them.
void NodeView::removeAllConnectionComponentsByNodeId | ( | int | nodeId | ) |
Remove ConnectionComponent from or to specified Node from NodeView.connectionsModel and destroy them.
nodeId | Node id |
bool NodeView::removeConnectionComponent | ( | ConnectionComponent | from, |
ConnectionComponent | to | ||
) |
Remove ConnectionComponent from NodeView.connectionsModel and destroy it.
from | |
to |
void NodeView::setPortsState | ( | string | state, |
string | filter | ||
) |
Set the state of PortsDockRow
state | PortsDockRow.state, see PortsDockRow.states |
filter | Set the state to the filtered PortsDockRow, use undefined to apply state for all PortsDockRow. |
void NodeView::updateAllConnectionComponents | ( | ) |
Clear NodeView.connectionsModel and recreate them from NodeView.model.
void NodeView::updateAllConnectionComponentsByNodeId | ( | int | nodeId | ) |
Remove connections from and to specified Node from NodeView.connectionsModel and recreate them from NodeView.model.
nodeId | Node id |
|
read |
Underlaying component that manages the connectionShape position, state and events.
Default: ConnectionComponent.
Definition at line 1 of file NodeView.qml.
|
read |
Connection deletion comfirmation dialog.
Default: ConnectionDeleteConfirmationDialog.
PortsDockRow from
and PortsDockRow to
are available in the scope.
Definition at line 1 of file NodeView.qml.
|
read |
The Shape that renders Connection, see ConnectionShape. Following properties can be bound to the parent component:
Definition at line 1 of file NodeView.qml.
|
read |
The underlaying model with the list of ConnectionComponent items.
Definition at line 1 of file NodeView.qml.
|
read |
Key that can be used to show Node or Connection Delete dialog on selected Node or Connection. Default Qt.Key_Delete.
Definition at line 1 of file NodeView.qml.
|
read |
Any row-based model should be supported, tested with a ListModel and a custom implementation of QAbstractListModel. The following roles are used by the NodeView in the model:
Example model:
Definition at line 1 of file NodeView.qml.
|
read |
Renders center content area in the Node, between left and right PortsDock. Component height must be defined, because it's used to calculate Node height.
Default: NodeCenterContent.
var nodeModel
is available in the scope.
Definition at line 1 of file NodeView.qml.
|
read |
Node deletion comfirmation dialog.
Default: NodeDeleteConfirmationDialog.
var nodeModel
is available in the scope.
Definition at line 1 of file NodeView.qml.
|
read |
Renders the Node header. Component height must be defined, because it's used to calculate Node height.
Default: NodeHeader.
var nodeModel
is available in the scope.
Definition at line 1 of file NodeView.qml.
|
read |
Renders left port description.
Default: NodeLeftPort
The following properties are available in the scope:
var portModel
var nodeModel
string state
// "highlighted", "hovered"QtObject style
Definition at line 1 of file NodeView.qml.
|
read |
Renders connection point near the PortsDockRow
Default: NodePortConnector
The following properties are available in the scope:
var portModel
var nodeModel
string state
// "highlighted", "hovered"QtObject style
Definition at line 1 of file NodeView.qml.
|
read |
Underlaying component that manages the NodePortConnector events.
Default: NodePortConnectorMouseArea
Definition at line 1 of file NodeView.qml.
|
read |
Renders right port description.
Default: NodeRightPort
The following properties are available in the scope:
var portModel
var nodeModel
string state
// "highlighted", "hovered"QtObject style
Definition at line 1 of file NodeView.qml.
|
read |
Renders top content area in the Node. Component height must be defined, because it's used to calculate Node height.
Default: NodeTopContent.
var nodeModel
is available in the scope.
Definition at line 1 of file NodeView.qml.
|
read |
The SnapGrid component.
Default: SnapGrid
An implementation should provide function function snapPosition(point) => point
Definition at line 1 of file NodeView.qml.
|
read |
Style object, see NodeViewStyle
Definition at line 1 of file NodeView.qml.