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

Private GIT Repository
correcting bugs but still exsitings
[blast.git] / GroupWidget.cpp
index 1446a137536f1fff029935bbb83e9a4e0c0ae2f5..043561e28c34495b6651725286860d3375335530 100644 (file)
@@ -223,11 +223,14 @@ void GroupWidget::updateBlockButton() {
 void GroupWidget::slotNewEmptyGroup() {
 
   // creating the GroupBlock in graph model
-  GroupBlock* groupBlock = params->addGroupBlock();
-  // creating the BlockItem in the inner scene
-  BoxItem* block = new BoxItem(groupBlock, dispatcher, params, scene->getGroupItem());
-
-  GroupWidget* child = dispatcher->createChildScene(this,block);
+  GroupBlock* parent = AB_TO_GRP(scene->getGroupItem()->getRefBlock());
+  cout << "new group : parent = "<< qPrintable(parent->getName()) << endl;
+  GroupBlock* groupBlock = params->getGraph()->createChildBlock(parent);
+  cout << "new group : child = "<< qPrintable(groupBlock->getName()) << ", child of " << qPrintable(groupBlock->getParent()->getName()) << endl;
+  // creating the BlockItem in the scene
+  BoxItem* newItem = scene->createBlockItem(groupBlock);
+
+  GroupWidget* child = dispatcher->createChildScene(this,newItem);
   child->show();
 }