Exemplo n.º 1
0
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
}
Exemplo n.º 2
0
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;
}