title: how to use mouse move event for QGraphicsScene?
body: <p>hey want to drag this bezier curve when mouse button is pressed and moved..</p>
  
  <p>I did this:</p>
  
  <pre><code>void MainWindow::mouseMoveEvent(QMouseEvent *e)
  {
  qDebug()&lt;&lt;"in mouse move - outside if";
  if((e-&gt;buttons() &amp; Qt::RightButton) &amp;&amp; isStart &amp;&amp; enableDrag)
  {
      qDebug()&lt;&lt;"mouse dragging happening";
      xc2=e-&gt;pos().x();
      yc2=e-&gt;pos().y();
      drawDragBezier(xc2,yc2);
  }
  }
  </code></pre>
  
  <p>this starts dragging when i press right button and start moving mouse in whole main window..but I want to start dragging only when I press mouse button and move mouse inside the QGraphicsScene.</p>
  
  <p>how to solve this?</p>
  
  <p>EDIT:</p>
  
  <pre><code>void mySubClass1::mousePressEvent(QGraphicsSceneMouseEvent *event)
  {
  if(event-&gt;button() == Qt::LeftButton)
  {
      qDebug()&lt;&lt;"in musubclass mouse press event: "&lt;&lt;event-&gt;pos().x()&lt;&lt;" "
  &lt;&lt;event- &gt;pos().y();
      if(shape().contains(event-&gt;pos()))
      {
          currPosX=event-&gt;pos().x();
          currPosY=event-&gt;pos().y();
          qDebug()&lt;&lt;"currPosX currPosY: "&lt;&lt;currPosX&lt;&lt;" "&lt;&lt;currPosY;
      }
  }
  }
  </code></pre>
  
  <p>And the mainwindow class is:</p>
  
  <pre><code>{
  myGPath=new mySubClass1();
  myScene=new QGraphicsScene;
  myScene-&gt;addItem(myGPath);
  ui-&gt;graphicsView-&gt;setScene(myScene);
  
  
  QPointF *startPoint=new QPointF(50,50);
  myPaintPath=new QPainterPath(*startPoint);
  
  myPaintPath-&gt;quadTo(100,25,200,200);
  
  myGPath-&gt;setPath(*myPaintPath);
  }
  </code></pre>
  
  <p>is this the right way?</p>