BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI::Model::ItemFactory Namespace Reference

Functions

SessionItemCreateItem (const QString &model_name, SessionItem *parent=nullptr)
 create SessionItem of specific type and parent More...
 

Function Documentation

◆ CreateItem()

SessionItem * GUI::Model::ItemFactory::CreateItem ( const QString &  model_name,
SessionItem parent = nullptr 
)

create SessionItem of specific type and parent

Definition at line 19 of file ItemFactory.cpp.

20 {
21  SessionItem* result = ItemCatalog::instance().createItemPtr(model_name).release();
22  if (parent)
23  parent->insertChild(-1, result);
24 
25  return result;
26 }
static ItemCatalog & instance()
Definition: ItemCatalog.cpp:80
std::unique_ptr< SessionItem > createItemPtr(const QString &modelType) const
Definition: ItemCatalog.cpp:86
Base class for a GUI data item.
Definition: SessionItem.h:204
void insertChild(int row, SessionItem *item, const QString &tag="")
Insert item into given tag into given row.

References ItemCatalog::createItemPtr(), SessionItem::insertChild(), and ItemCatalog::instance().

Referenced by SessionItem::addGroupProperty(), GroupItemController::addItem(), SessionItem::addProperty(), and SessionModel::insertNewItem().

Here is the call graph for this function: