int GroupScene::setItemsId(int countInit) {
int counter = countInit;
groupItem->setId(counter++);
+ if (isTopScene()) {
+ foreach(SourceItem *item, sourceItems){
+ item->setId(counter++);
+ }
+ }
foreach(BoxItem *item, boxItems){
item->setId(counter++);
}
foreach(InterfaceItem* inter, groupItem->getInterfaces()){
inter->setId(counter++);
}
+ if (isTopScene()) {
+ foreach(SourceItem *item, sourceItems){
+ foreach(InterfaceItem* inter, item->getInterfaces()){
+ inter->setId(counter++);
+ }
+ }
+ }
foreach(BoxItem *item, boxItems){
foreach(InterfaceItem* inter, item->getInterfaces()){
inter->setId(counter++);
}
void GroupScene::addSourceItem(SourceItem* item) {
+ // adding item to the scene
+ addItem(item);
+ item->setZValue(1);
// add item from the QList
sourceItems.append(item);
}
}
void GroupScene::removeConnectionItem(ConnectionItem* item) {
+
+ // remove connection from/to InterfaceItem
+ InterfaceItem* fromIfaceItem = item->getFromInterfaceItem();
+ InterfaceItem* toIfaceItem = item->getToInterfaceItem();
+ fromIfaceItem->removeConnectionItem(item);
+ toIfaceItem->removeConnectionItem(item);
+
// remove item from the viewport
removeItem(item);
// remove item from the QList