title: How can I skip QGraphicsItems obscured by identical QGraphicsItems?
body: <p>I am adding items on a <code>QGraphicsScene</code>. Once added, items may be further processed.</p>
  
  <p>I would like to skip the items completely obscured by other items. It seems that there are several <code>QGraphicsItems</code> dedicated to this task. </p>
  
  <p>Given two <code>QGraphicsItem</code> objects, in the shape of a rectangle, identical in size, only differing by color, and each with identical <code>boundingRect()</code>, each at exactly the same <code>pos()</code>, but with different <code>zValue()</code>:</p>
  
  <pre><code>for(int i = 0; i &lt; scene.items().size(); ++i)
  {
      if(scene.items().at(i)-&gt;isObscured())
      {
          continue;
      }
      // do work
  }
  </code></pre>
  
  <p>I also tried </p>
  
  <pre><code>    if(scene-&gt;items().at(i)-&gt;isObscured(scene-&gt;items().at(i)-&gt;boundingRect()))
  </code></pre>
  
  <p>Neither option skips the item that is not visible.</p>
  
  <p>If I increase slightly the size of the rectangle on top, the <code>isObscured</code> function works (either version). But with identical shapes, one on top of the other, logically the bottom one would still be obscured...</p>
  
  <p>Would a reasonable fix be to add 1 pixel on each side of the rectangle ? would that not lead to weird situations ?</p>
  
  <p>How can I make items that are covered be skipped ? </p>
  
  <p>This issue is even more complicated if one item is covered by several other items, neither of them fully covering the item.</p>