BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::LabelDataRowStrategy Class Reference

Constructs row of QStandardItem's for given SessionItem. More...

Inheritance diagram for ModelView::LabelDataRowStrategy:
[legend]
Collaboration diagram for ModelView::LabelDataRowStrategy:
[legend]

Public Member Functions

std::vector< std::unique_ptr< ViewItem > > constructRow (SessionItem *) override
 
QStringList horizontalHeaderLabels () const override
 Example: For LayerItem two items will be generated: ViewLabelItem and ViewEmptyItem, both uneditable. More...
 

Detailed Description

Constructs row of QStandardItem's for given SessionItem.

Row consists of two columns, ViewLabelItem for SessionItem's display role and ViewDataItem for Session's item data role.

Definition at line 30 of file labeldatarowstrategy.h.

Member Function Documentation

◆ constructRow()

std::vector< std::unique_ptr< ViewItem > > LabelDataRowStrategy::constructRow ( SessionItem item)
overridevirtual

Implements ModelView::RowStrategyInterface.

Definition at line 31 of file labeldatarowstrategy.cpp.

32 {
33  std::vector<std::unique_ptr<ViewItem>> result;
34 
35  if (!item)
36  return result;
37 
38  result.emplace_back(std::make_unique<ViewLabelItem>(item));
39  result.emplace_back(std::make_unique<ViewDataItem>(item));
40  return result;
41 }

Referenced by TEST_F().

◆ horizontalHeaderLabels()

QStringList LabelDataRowStrategy::horizontalHeaderLabels ( ) const
overridevirtual

Example: For LayerItem two items will be generated: ViewLabelItem and ViewEmptyItem, both uneditable.

For LayerItem's thickness property, two items will be generated: ViewLabelItem and ViewDataItem.

Implements ModelView::RowStrategyInterface.

Definition at line 25 of file labeldatarowstrategy.cpp.

26 {
27  return QStringList() << "Name"
28  << "Value";
29 }

Referenced by TEST_F().


The documentation for this class was generated from the following files: