Creation of new GUI object¶
Suppose there is a class KoolThing (derived from ISample, and yes, with a 'K') in the core library of BornAgain and we want to use this in the GUI (sample editor, ...)This requires the following steps:
- Create and implement KoolThingItem (create new source and header file for this)
- In 'item_constants.h', add a new ModelType, e.g. KoolThingType
- Add and implement GUIObjectBuilder::visit(const KoolThing *); this will enable the creation of a KoolThingItem from a KoolThing object
- To be able to drag and drop the item from the widgetbox, add a new categoryentry in widgetbox.xml (and create an appropriate icon)
- Add entry in map of ItemFactory for creation of KoolThingItem
- If needed (depends on complexity of creation of domain object from GUI object), add createKoolThing method to TransferToDomain
- Add and implement buildKoolThing method in DomainObjectBuilder
- Create and implement KoolThingView (create header and source file for this)
- Implement correct creation of KoolThingView from KoolThingType in SampleViewFactory
- Create GUI functional test