BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
labeldatarowstrategy.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/viewmodel/mvvm/viewmodel/labeldatarowstrategy.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "mvvm/model/sessionitem.h"
18 
19 using namespace ModelView;
20 
21 //! Example:
22 //! For LayerItem two items will be generated: ViewLabelItem and ViewEmptyItem, both uneditable.
23 //! For LayerItem's thickness property, two items will be generated: ViewLabelItem and ViewDataItem.
24 
26 {
27  return QStringList() << "Name"
28  << "Value";
29 }
30 
31 std::vector<std::unique_ptr<ViewItem>> LabelDataRowStrategy::constructRow(SessionItem* item)
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 }
std::vector< std::unique_ptr< ViewItem > > constructRow(SessionItem *) override
QStringList horizontalHeaderLabels() const override
Example: For LayerItem two items will be generated: ViewLabelItem and ViewEmptyItem,...
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Defines class CLASS?