Skip to content

Technical notes on gear creation

jukea edited this page Jan 15, 2013 · 11 revisions

Gear added by GUI drag&drop. Code flow analysis starting from the DropEvent:

  • SchemaEditor::dropEvent
  • | SchemaEditor::addGear(..)
  • | | SchemaGui::addGear(..)
  • | | | Gear* gear = GearMaker::makeGear(fullname);
  • | | | | GearInfo *gearInfo = findGearInfo(fullName);
  • | | | | thegear = gearInfo->createGearInstance();
  • | | | | thegear->init();
  • | | | | | (gear::)internalInit();
  • | | | | GearInfo *gearInfo = findGearInfo(fullName);
  • | | | Schema::addGear(gear)
  • | | | | gear.name(mangleUniqueGearName(gear.name()))
  • | | | | gear.parentSchema(*this);
  • | | | | emit gearAdded(*this, gear);
  • | | | Engine::onGearAdded
  • | | | ?

Notes :

  • Most events should be handled by QGraphicsScene (SchemaGui) directly, not bw QGraphicsView (SceneEditor). This is an unnecessary proxy

--> prePlay vs internalInit … what's the difference ?