title: How to add children to QGraphicsItem
body: <p>I have the following code, where I'm trying to have two rectangles, and then inside each, display "sub" rectangles (this is the code for one parent and one child)</p>
  
  <pre><code>auto graphicsView = std::make_unique&lt;QGraphicsView&gt;();
  auto scene = std::make_unique&lt;QGraphicsScene&gt;();
  graphicsView-&gt;setScene(scene.get());
  
  auto parent1 = std::make_unique&lt;QGraphicsRectItem&gt;(0, 0, 100, 200);
  parent1-&gt;setBrush(QBrush(QColor(Qt::cyan)));
  
  scene-&gt;addItem(parent);
  
  auto subRect1 = std::make_unique&lt;QGraphicsRectItem&gt;(10, 10, 50, 50, parent1);
  subRect1-&gt;setBrush(QBrush(QColor(Qt::yellow)));
  </code></pre>
  
  <p>And I was excepting that when I display my <code>QGraphicsView</code>, I would see a cyan rectangle (<code>parent1</code>), on top of which I would also see a yellow smaller rectangle (<code>subRect1</code>), but I'm only able to see the cyan one.  </p>
  
  <p>Looking at Qt's documentation, I see that they talk about the fact that <code>QGraphicsItem</code> can have children, but why am I not seeing the child here?</p>
  
  <p>PS: I tried adding the child in 3 different ways, but no luck:  </p>
  
  <ol>
  <li>Passing the parent to the constructor (as I've shown above)</li>
  <li>Calling <code>setParentItem</code> on the child and passing the parent's pointer</li>
  <li>Calling parent's <code>childItems()</code> and then <code>push_back</code> or <code>append</code> and passing child's pointer to it</li>
  </ol>