]> AND Private Git Repository - blast.git/blobdiff - BoxItem.cpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
correct relative positionning of source/group
[blast.git] / BoxItem.cpp
index 6e6f15aace5731771cc753171d3b0af4ba77877a..190200339538cf01b94eb41af66d076e65261b30 100644 (file)
@@ -342,7 +342,7 @@ void BoxItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
     }
   }
   else if (mode == GroupScene::ItemEdition) {
     }
   }
   else if (mode == GroupScene::ItemEdition) {
-    setZValue(zValue()+100);
+    //setZValue(zValue()+100);
     if (params->cursorState == Parameters::CursorOnInterface) {
       InterfaceItem *inter = getInterfaceFromCursor(x,y);
       if (inter != NULL) {
     if (params->cursorState == Parameters::CursorOnInterface) {
       InterfaceItem *inter = getInterfaceFromCursor(x,y);
       if (inter != NULL) {
@@ -373,7 +373,7 @@ void BoxItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
 
 void BoxItem::mouseReleaseEvent(QGraphicsSceneMouseEvent  *event) {
 
 
 void BoxItem::mouseReleaseEvent(QGraphicsSceneMouseEvent  *event) {
 
-  setZValue(zValue()-100);
+  //setZValue(zValue()-100);
 
   int mode = getScene()->getEditionMode();
 
 
   int mode = getScene()->getEditionMode();
 
@@ -397,7 +397,9 @@ void BoxItem::mouseReleaseEvent(QGraphicsSceneMouseEvent  *event) {
       bool ok = dispatcher->createConnectionItem(iface1,iface2);
       if (ok) {
         iface1->selected = false;
       bool ok = dispatcher->createConnectionItem(iface1,iface2);
       if (ok) {
         iface1->selected = false;
-        // no update needed since the whole scene will be repainted
+        update(iface1->boundingRect());
+        iface2->selected = false;
+        update(iface2->boundingRect());        
         getScene()->setSelectedInterface(1,NULL);
         getScene()->setSelectedInterface(2,NULL);
         params->setEditState(Parameters::EditNoOperation);
         getScene()->setSelectedInterface(1,NULL);
         getScene()->setSelectedInterface(2,NULL);
         params->setEditState(Parameters::EditNoOperation);
@@ -483,13 +485,12 @@ void BoxItem::hoverMoveEvent(QGraphicsSceneHoverEvent * event) {
       }
     }
   }
       }
     }
   }
-  QGraphicsItem::hoverMoveEvent(event);
+  //QGraphicsItem::hoverMoveEvent(event);
+  event->ignore();
 }
 
 
 }
 
 
-void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {
-
-  event->accept();
+void BoxItem::contextMenuEvent(QGraphicsSceneContextMenuEvent * event) {  
   
   QMenu menu;
   QAction* titleAction = NULL;
   
   QMenu menu;
   QAction* titleAction = NULL;
@@ -743,7 +744,7 @@ void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) {
     functionalBlock->addInterface(functionalInterface);
     
     // searching for control interface
     functionalBlock->addInterface(functionalInterface);
     
     // searching for control interface
-    QString ctlRefName = refName+"_ctl";
+    QString ctlRefName = refName+"_enb";
     ReferenceInterface* ctlRefIface = AI_TO_REF(reference->getIfaceFromName(ctlRefName));
     
     if (ctlRefIface != NULL) {
     ReferenceInterface* ctlRefIface = AI_TO_REF(reference->getIfaceFromName(ctlRefName));
     
     if (ctlRefIface != NULL) {
@@ -752,7 +753,7 @@ void BoxItem::loadFunctional(QDomElement funcElement) throw(Exception) {
       if (! ctlIface->setAssociatedIface(functionalInterface)) {
         throw(Exception(PROJECTFILE_CORRUPTED));
       }      
       if (! ctlIface->setAssociatedIface(functionalInterface)) {
         throw(Exception(PROJECTFILE_CORRUPTED));
       }      
-      ctlIface->setName(name+"_ctl");
+      ctlIface->setName(name+"_enb");
       functionalBlock->addInterface(ctlIface);
     }    
   }
       functionalBlock->addInterface(ctlIface);
     }    
   }