title: QGraphicsScene, error by accessing pointer in custom class
body: <p>I have a pretty complex problem... In Qt I have a custom class (named FotoGebouw) that inherits from QGraphicsItem, it also contains a pointer to another custom class (named Gebouw). If I want to acces the selected items from the scene, in other words the "FotoGebouw"items, I first have to cast them to QGraphicsItems. But this way, I seem to lose the pointer (called linkGebouw) that they were pointing to. </p>
  
  <p>Does anyone know a way to get the FotoGebouw items that are selected from the scene, while I can still get the </p>
  
  <pre><code>QList&lt;QGraphicsItem *&gt;bordSceneGebouwen=bordscene-&gt;selectedItems();
  FotoGebouw *teVerplaatsenFoto=dynamic_cast&lt;FotoGebouw *&gt;(bordSceneGebouwen[0]);
  Gebouw *teVerplaatsen=teVerplaatsenFoto-&gt;linkGebouw;
  </code></pre>