Logo Search packages:      
Sourcecode: ktechlab version File versions

void ICNDocument::appendDeleteList ( QCanvasItem *  qcanvasItem  )  [virtual, inherited]

Adds a QCanvasItem to the delete list to be deleted, when flushDeleteList() is called

Implements ItemDocument.

Definition at line 497 of file icndocument.cpp.

References Connector::removeConnector().

{
      if ( !qcanvasItem || m_itemDeleteList.findIndex(qcanvasItem) != -1 )
            return;
      
      m_itemDeleteList.append(qcanvasItem);

/* the issue here is that we don't seem to have a generic call for all of these so we have to
spend time figuring out which method to call...
*/

      if ( Node *node = dynamic_cast<Node*>(qcanvasItem) )
            node->removeNode();
      else if ( Item *item = dynamic_cast<Item*>(qcanvasItem) )
            item->removeItem();
      else {
            Connector * connector = dynamic_cast<Connector*>(qcanvasItem);
            if (!connector) {
                  if ( ConnectorLine * cl = dynamic_cast<ConnectorLine*>(qcanvasItem) )
                        connector = cl->parent();
            }

            if(connector) connector->removeConnector();
            else kdWarning() << k_funcinfo << "unrecognised QCanvasItem " << qcanvasItem << endl;
      }
}


Generated by  Doxygen 1.6.0   Back to index