I have a simple problem that I cannot figure out how to solve. I have a QGraphicsView that has a few QGraphicsItems inside of it. When the user clicks and drags inside the QGraphicsView it scrolls the image. I need to intercept this event, and so I implemented

Qt Code:
  1. void
  2. MyQGraphicsView::
  3. mouseMoveEvent(QMouseEvent *event) {
  4. if (event->buttons() == Qt::LeftButton) {
  5. std::cout << "mouse move event\n";
  6. }
  7. QGraphicsView::mouseMoveEvent(event);
  8. }
To copy to clipboard, switch view to plain text mode 

This part works fine. However, when the user clicks and drags one of the QGraphicsItems, this event is also triggered. I do not want this - I want the mouseMoveEvent in the QGraphicsView only to trigger if the mouse was dragged when not on a QGraphicsItem. Any suggestions?