title: QGraphicsitem sceneEvent handler
body: <p>What I am trying to implement is the following:</p>
  
  <p>I have a QGraphicsitem I could use <strong>mouse or finger</strong> to press and drag on it, so its color will change gradually depend on the drag.</p>
  
  <p>Also I would like to resize it using touch event.</p>
  
  <p>I have already done all the mouse related event handler like mousePressEvent, mouseMoveEvent and mouseReleaseEvent. And it seems the touch event is translated into a mouse event by default under Windows.</p>
  
  <p>Now I add the following code to re-implement the graphicItem's sceneEvent function:</p>
  
  <pre><code>bool MapGraphicItem::sceneEvent(QEvent * event)
      {
          switch (event-&gt;type()) {
          case QEvent::TouchBegin:
          case QEvent::TouchUpdate:
          case QEvent::TouchEnd:
              QTouchEvent *touchEvent = static_cast&lt;QTouchEvent *&gt;(event);
              QList&lt;QTouchEvent::TouchPoint&gt; touchPoints = touchEvent-&gt;touchPoints();
              if (touchPoints.count() == 2) {
                  //do the zoom
                  }
              return true;
          }
  
          return QGraphicsItem::sceneEvent(event);
      }
  </code></pre>
  
  <p>The zoom also works, the problem is during pinch zoom, the mouse Events are also triggered so the color is changed which I don't want.</p>
  
  <p>How to deal with this?</p>