hey I am drawing a bezier curve on QGraphicsScene.
Initialy I was drawing curve using path and drawing it in pixmap and then adding pixmap to scene.
This allows me to add multiple paths to scene through pixmap.

Qt Code:
  1. drawGlyphs=new QPixmap(800, 800);
  2. drawGlyphs->fill(Qt::white);
  3. QPainter p(drawGlyphs);
  4. p.setViewport(50,200,400,400);
  5. p.setPen(Qt::black);
  6. p.drawPath(mypath);
  7. pScene->addPixmap(*drawGlyphs);
To copy to clipboard, switch view to plain text mode 

I wanted to check if the mouse click is on one of the paths. But with above structure I couldn't do that.
So I subclass QGraphicsPathItem.

Qt Code:
  1. class mySubClass1 : public QGraphicsPathItem
  2. {
  3. public:
  4. mySubClass1();
  5. protected:
  6. void mousePressEvent(QGraphicsSceneMouseEvent *event);
  7. }
To copy to clipboard, switch view to plain text mode 

Here I am drawing curve in painter path, setting this path to object of 'mySubClass1' and adding this object as item to scene.
Now when I try to implement mouse move event I could not detect on which point which is on the curve I clicked and trying to drag.

How do I solve this problem?
Is the structure of my program correct?