title: Child items not movable in QGraphicsView when ItemIsMovable flag is set
body: <p>To resize items in a <a href="http://qt-project.org/doc/qt-5.0/qtwidgets/qgraphicsview.html" rel="nofollow noreferrer">QGraphicsView</a>, I'm putting child items representing vertices onto the item to be moved (using the parent-child relationship established in the constructor).  Those are the four blue circles in the picture below:</p>
  
  <p><img src="https://i.stack.imgur.com/WZ99w.png" alt="an example"></p>
  
  <p>But the child vertices are not receiving mouse events.  Only the parent item (red square) is getting mouse events.</p>
  
  <p>Here is the definition for <code>Item</code>:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>Item::Item(QGraphicsItem * parent) :
      QGraphicsItem(parent)
  {
      setFlag(ItemIsMovable);
      setFlag(ItemIsSelectable);
      setFlag(ItemSendsGeometryChanges);
      setCacheMode(DeviceCoordinateCache);   
  }
  
  void Item::paint(
      QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  {
      painter-&gt;fillRect(option-&gt;rect,Qt::red);
  }
  
  QVariant Item::itemChange(GraphicsItemChange change, const QVariant &amp; value)
  {
      switch(change)
      {
          case QGraphicsItem::ItemSelectedHasChanged:
              qWarning() &lt;&lt; "item: " + value.toString();
              updateVertices(value.toBool());
              break;
          default:
              break;
      }
      return QGraphicsItem::itemChange(change, value);
  }
  
  void Item::updateVertices(bool visible) {
      if(visible) {
          if(vertices.length() == 0) {
              for(int i = 0; i &lt; 4; i++)
                  vertices.append(new Vertice(this));
          } else
              for(int i = 0; i &lt; 4; i++)
                  vertices[i]-&gt;setVisible(true);
  
          QRectF rect = boundingRect();
          vertices[0]-&gt;setPos(rect.topLeft());
          vertices[1]-&gt;setPos(rect.topRight());
          vertices[2]-&gt;setPos(rect.bottomLeft());
          vertices[3]-&gt;setPos(rect.bottomRight());
      } else {
          for(int i = 0; i &lt; 4; i++) {
              p_vertices[i]-&gt;setVisible(false);
          }
      }
  }
  </code></pre>
  
  <p>While here is the definition for <code>Vertice</code>:</p>
  
  <pre><code>Vertice::Vertice(QGraphicsItem * parent) :
      QGraphicsItem(parent)
  {
      setFlag(ItemIsMovable);
      setFlag(ItemIsSelectable);
      setFlag(ItemSendsGeometryChanges);
  }
  
  void Vertice::paint(
      QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
  {
      painter-&gt;setBrush(Qt::blue);
      painter-&gt;setPen(Qt::darkGray);
      painter-&gt;drawEllipse(-5,-5,10,10);
  }
  
  QVariant Vertice::itemChange(GraphicsItemChange change, const QVariant &amp; value)
  {
      switch(change) {
          case QGraphicsItem::ItemSelectedHasChanged:
              qWarning() &lt;&lt; "vertex: " + value.toString(); // never happened
              break;
          default:
              break;
      }
  }
  </code></pre>