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

Widget holding grid layout with editors and intended for displaying all properties of given SessionItem. More...

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

Classes

struct  PropertyFlatViewImpl
 

Public Member Functions

 PropertyFlatView (QWidget *parent=nullptr)
 
 ~PropertyFlatView ()
 
void setItem (SessionItem *item)
 

Private Attributes

std::unique_ptr< PropertyFlatViewImplp_impl
 

Detailed Description

Widget holding grid layout with editors and intended for displaying all properties of given SessionItem.

Definition at line 29 of file propertyflatview.h.

Constructor & Destructor Documentation

◆ PropertyFlatView()

PropertyFlatView::PropertyFlatView ( QWidget *  parent = nullptr)

Definition at line 142 of file propertyflatview.cpp.

143  : QWidget(parent), p_impl(std::make_unique<PropertyFlatViewImpl>())
144 {
145  auto main_layout = new QVBoxLayout;
146  main_layout->setMargin(0);
147  main_layout->setSpacing(0);
148 
149  p_impl->grid_layout->setSpacing(6);
150  main_layout->addLayout(p_impl->grid_layout);
151  main_layout->addStretch(1);
152 
153  setLayout(main_layout);
154 }
std::unique_ptr< PropertyFlatViewImpl > p_impl

References p_impl.

◆ ~PropertyFlatView()

PropertyFlatView::~PropertyFlatView ( )
default

Member Function Documentation

◆ setItem()

void PropertyFlatView::setItem ( SessionItem item)

Definition at line 158 of file propertyflatview.cpp.

159 {
160  p_impl->view_model = Factory::CreatePropertyFlatViewModel(item->model());
161  p_impl->view_model->setRootSessionItem(item);
162  p_impl->connect_model();
163  p_impl->update_grid_layout();
164 }
SessionModel * model() const
Returns the model to which given item belongs to.
MVVM_VIEWMODEL_EXPORT std::unique_ptr< ViewModel > CreatePropertyFlatViewModel(SessionModel *model)
Creates view model to represent SessionModel for Qt views.

References ModelView::Factory::CreatePropertyFlatViewModel(), ModelView::SessionItem::model(), and p_impl.

Referenced by TEST_F().

Here is the call graph for this function:

Member Data Documentation

◆ p_impl

std::unique_ptr<PropertyFlatViewImpl> ModelView::PropertyFlatView::p_impl
private

Definition at line 40 of file propertyflatview.h.

Referenced by PropertyFlatView(), and setItem().


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