c++ program crashes when adding new QGraphicsItem to scene
<p>My c++ program crashes when i add new QGraphicsLineItem to a QList of QGraphicsPixmapItem.
Below is the function.</p>

<pre><code>void MainWindow::linkComputerNodes(QList&lt;Node*&gt; routers)
{

    for(int i=0;i&lt;routers.length();i++)
    {
       scene-&gt;addItem(new Link(routers.at(i),routers.at(i+1)));
    }
 }
</code></pre>