BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ItemFactory Namespace Reference

Functions

SessionItemCreateEmptyItem ()
 create empty SessionItem that serves as a root item More...
 
SessionItemCreateItem (const QString &model_name, SessionItem *parent=nullptr)
 create SessionItem of specific type and parent More...
 
QStringList ValidTopItemTypes ()
 retrieve list of all possible item types suitable for More...
 

Function Documentation

◆ CreateEmptyItem()

SessionItem * ItemFactory::CreateEmptyItem ( )

create empty SessionItem that serves as a root item

Definition at line 39 of file ItemFactory.cpp.

40 {
41  return new SessionItem("ROOT_ITEM");
42 }

Referenced by SessionModel::createRootItem(), and SessionModel::load().

◆ CreateItem()

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

create SessionItem of specific type and parent

Definition at line 30 of file ItemFactory.cpp.

31 {
32  SessionItem* result = catalog().createItemPtr(model_name).release();
33  if (parent)
34  parent->insertItem(-1, result);
35 
36  return result;
37 }
bool insertItem(int row, SessionItem *item, const QString &tag="")
Insert item into given tag into given row.

References SessionItem::insertItem().

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

Here is the call graph for this function:

◆ ValidTopItemTypes()

QStringList ItemFactory::ValidTopItemTypes ( )

retrieve list of all possible item types suitable for

Definition at line 44 of file ItemFactory.cpp.

45 {
46  return catalog().validTopItemTypes();
47 }

Referenced by SampleTreeWidget::showContextMenu().