BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
FitParameterHelper Namespace Reference

Description

Convenience static methods to handle various fitting items in given JobItem.

Functions

ParameterItemgetParameterItem (FitParameterContainerItem *container, const QString &link)
 Returns ParameterItem corresponding to given link. More...
 

Function Documentation

◆ getParameterItem()

ParameterItem * FitParameterHelper::getParameterItem ( FitParameterContainerItem container,
const QString &  link 
)

Returns ParameterItem corresponding to given link.

Definition at line 22 of file FitParameterHelper.cpp.

24 {
25  // Link is relative to ParameterContainerItem, so first we have to find it
26  SessionItem* cur = container;
27  while (cur && cur->modelType() != JobItem::M_TYPE)
28  cur = cur->parentItem();
29  ASSERT(cur && cur->modelType() == JobItem::M_TYPE);
30  auto* jobItem = dynamic_cast<JobItem*>(cur);
31  ASSERT(jobItem);
32  return jobItem->parameterContainerItem()->findParameterItem(link);
33 }
static constexpr auto M_TYPE
Definition: JobItem.h:62
Base class for a GUI data item.
Definition: SessionItem.h:204
SessionItem * parentItem() const
Returns parent of this item.
Definition: SessionItem.cpp:67
QString modelType() const
Get model type.

References JobItem::M_TYPE, SessionItem::modelType(), and SessionItem::parentItem().

Referenced by FitParameterModel::mimeData().

Here is the call graph for this function: