title: Dragged QGraphicsItem not visible in items() function
body: <p>I have created a <code>QGraphicsScene</code> scene and added some graphcis items (lines, rectangles) etc to the scene.</p>
  
  <p>I can loop through them using  this list :</p>
  
  <pre><code> QList&lt;QGraphicsItem*&gt; all = items();
  </code></pre>
  
  <p>I enabled movement for these items and I am able to drag them by click selecting them. But after an element has been dragged, it stops showing up in the call to <code>items()</code> function of the <code>QGraphicsScene</code>.</p>
  
  <pre><code>QList&lt;QGraphicsItem*&gt; all = items();
  </code></pre>
  
  <p>None of the dragged items show up in the above list, while non-dragged ones do show up.</p>
  
  <p>Does dragging the QGraphicScene elements change their parent ? or any other reason somebody could suggest for such an issue ?</p>
  
  <p>{P.S. Code is too very big to share}</p>
  
  <hr>
  
  <p>Edit 1 :</p>
  
  <p>I am using the flags <code>QGraphicsItem::ItemIsSelectable</code> and <code>QGraphicsItem::ItemIsMovable</code> for making the items movable.</p>
  
  <pre><code>foreach(QGraphicsItem* itemInVisualScene, items())
  {
          itemInVisualScene-&gt;setFlag(QGraphicsItem::ItemIsSelectable, itemsMovable);
          itemInVisualScene-&gt;setFlag(QGraphicsItem::ItemIsMovable, itemsMovable);
  }
  </code></pre>
  
  <p>By default I add few rectangle to the scene. Then in the 'move mode' I drag them around. Then in the 'add mode' I click on screen to add new rectangles. I have written a logic to check if I am clicking on any existing drawn rectangle :</p>
  
  <pre><code>void Scene::mousePressEvent(QGraphicsSceneMouseEvent * event)
  {
  if(eDrawLines == sceneMode)
  {
          dragBeginPoint = event-&gt;scenePos();
          dragEndPoint = dragBeginPoint;
          QList&lt;QGraphicsItem*&gt; all = items();
  
          for (int i = 0; i &lt; all.size(); i++)
          {
              QGraphicsItem *gi = all[i];
  
              // Clicked point lies inside existing rect
              if( QGraphicsRectItem::Type == gi-&gt;type() &amp;&amp; gi-&gt;contains(dragBeginPoint))
              {
                  std::cout &lt;&lt; "Pressed inside existing rect" &lt;&lt; std::endl;
                  return;
              }
          }
          std::cout &lt;&lt; "Point not found, add new rectangle" &lt;&lt; std::endl;            
  }
  
  QGraphicsScene::mousePressEvent(event);
  }
  </code></pre>
  
  <p>This adding of rectangles work fine for rects which were not dragged in the 'move mode'. But rects which were moved do not seem to recognize the click anymore. My control comes out of the loop even when I click on an existing rectangle which was dragged earlier.</p>