Important: Please read the Qt Code of Conduct -

Curve editor, compare QGraphicsPathItem and the demo pathstroke.

  • i want to implement a curve editor like qwt, but also i want scale the whole view, and the control points of the curve are drawn and they can be moved, inserted, and deleted.
    now i have 2 ways to do this.

    1. i found the demo pathstroke, it use the QWidget, and the control points can be moved.
      the question is how to scale it, is it easy for the curves in the QWidget? and in mousePressEvent all the points are iterated to find the pressed point, so it's bad when there are not only 1 lines there, and is there any way better for this?

    2. use the QGraphicsView/Scene, i customize a child class from QGraphicsPathItem. it's easy to scale.
      and i want to draw the control points in its paintEvent func. and move them will be implemented in the QGraphicsView's mouseEvent func.
      should this work fine?

    finally, i want to know which one is the better way to realize the curve editor as i descibed
    thank you

  • no replys?
    thanks for all

Log in to reply