Results 1 to 3 of 3

Thread: Fixed point while dragging curve

  1. #1
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Fixed point while dragging curve

    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 

  2. #2
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Fixed point while dragging curve

    SOLVED, by myself.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Fixed point while dragging curve

    Would be cool if you could post the solution, in case someone else encounters a similar problem and finds this thread

    Cheers,
    _

Similar Threads

  1. change color on dragging curve
    By bchinfosieeuw in forum Newbie
    Replies: 2
    Last Post: 9th August 2016, 14:02
  2. Tool tip in point of curve
    By ruzik in forum Qwt
    Replies: 4
    Last Post: 23rd October 2011, 13:23
  3. Replies: 3
    Last Post: 21st June 2011, 20:37
  4. Replies: 2
    Last Post: 28th April 2011, 09:42
  5. get the point of a fitted curve
    By giusepped in forum Qwt
    Replies: 1
    Last Post: 2nd January 2009, 05:03

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.