DiagramItem* DiagramScene::getItemById(int id)
{

    for(int i=0;i<diagItems.count();i++)
    {
        DiagramItem* tmp = diagItems.at(i);
        if(tmp->id() == id)
            return tmp;
    }
    return 0; // Null
}
QDomNode DiagramScene::createArrowXml(Connector* start, Connector* end)
{
    QDomElement item = projXml->createElement("arrow");
    DiagramItem* startParent = (DiagramItem*)start->parentItem();
    DiagramItem* endParent   = (DiagramItem*)end->parentItem();

    /**
     * parentInId is arrow source
     */
    item.setAttribute("parentInId",startParent->id());
    item.setAttribute("connectorInId",start->id());

    item.setAttribute("parentOutId",endParent->id());
    item.setAttribute("connectorOutId",end->id());

    diagramXml.appendChild(item);
    ((DiagramWindow*)parent())->updateXml();

    return item;
}