How to set a fixed point on one of the endpoints of a curve, that is fixed while dragging so the shape of the curve changes? (-item1.y is the y-coordinate of the Item-id; this is a fixed number with normal rectangles)

Qt Code:
  1. Path {
  2. id: bendline
  3. startX: -146; startY: -12
  4. PathCurve { x: -138; y: -17 }
  5. PathCurve { x: -132; y: -25 }
  6. PathCurve { x: -130; y: -item1.y+365 }
  7. property color mycolor: "black"
  8. }
  9.  
  10. MouseArea {
  11. anchors.fill: parent
  12. onPositionChanged: {
  13. if (mouse.buttons & Qt.LeftButton) {
  14. bendline.x -= (x - mouse.x); bendline.y = -item1.y+365;
  15. }
  16. }
  17.  
  18. PathView {
  19. id: bendView;
  20. x: 10
  21. y: 20
  22. model: { item1.y >= 387 && item1.y < 459 ? 300 : 0 }
  23. path: bendline
  24. delegate: Rectangle {
  25. id: dot;
  26. width: 1; height: 1;
  27. color: bendline.mycolor
  28. }
  29. }
To copy to clipboard, switch view to plain text mode