QmlNodeEditor
PortsDockRow.qml
Go to the documentation of this file.
1 import QtQuick 2.15
2 import QtQuick.Controls 2.15
3 
4 Row {
5  id: portDockRow
6  layoutDirection: nodePortDock.layoutDirection
7 
8  property var portModel: model.portId ? model : modelData
9 
10  property int portId: portModel.portId
11  property int nodeId: nodeRoot.nodeModel.nodeId
12 
13  property string tags: portModel.tags || ""
14 
15  property real relativeConnectorX: nodePortDock.relativeX +
16  portDockRepeater.x +
17  x +
18  portConnectorItem.x +
19  portConnectorLoader.x +
20  portConnectorLoader.width / 2
21 
22  property real relativeConnectorY: nodePortDock.relativeY +
23  portDockRepeater.y +
24  y +
25  portConnectorItem.y +
26  portConnectorLoader.y +
27  portConnectorLoader.height / 2
28 
29  function getNodeRoot() {
30  return nodeRoot;
31  }
32 
33  states: [
34  State {
35  name: "highlighted"
36  },
37  State {
38  when: hoverHandler.hovered
39  name: "hovered"
40  }
41  ]
42  HoverHandler {
43  id: hoverHandler
44  }
45 
46  Item {
47  id: portConnectorItem
48  width: nodeView.style.nodePortConnectorMargin
49  anchors.top: parent.top
50  anchors.bottom: parent.bottom
51  Loader {
52  id: portConnectorLoader
53  property var portModel: portDockRow.portModel
54  property var nodeModel: nodeRoot.nodeModel
55  property string state: portDockRow.state
56  property QtObject style: nodeView.style
57  anchors.verticalCenter: parent.verticalCenter
58  anchors.horizontalCenter: parent.horizontalCenter
59  sourceComponent: nodeView.nodePortConnectorComponent
60  }
61  Loader {
62  anchors.top: parent.top
63  anchors.bottom: parent.bottom
64  anchors.left: portConnectorLoader.left
65  anchors.right: portConnectorLoader.right
66  property var portModel: portDockRow.portModel
67  property var nodeModel: nodeRoot.nodeModel
68  property string state: portDockRow.state
69  property QtObject style: nodeView.style
70  sourceComponent: nodeView.nodePortConnectorMouseArea
71  }
72  }
73  Loader {
74  property var portModel: portDockRow.portModel
75  property var nodeModel: nodeRoot.nodeModel
76  property string state: portDockRow.state
77  property QtObject style: nodeView.style
78  width: nodePortDock.width - portConnectorItem.width
79  sourceComponent: nodePortDock.nodePortComponent
80  }
81 }