BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
propertytreeview.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/view/mvvm/widgets/propertytreeview.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 
17 #include "mvvm/model/sessionitem.h"
19 #include <QTreeView>
20 
21 using namespace ModelView;
22 
24 {
25  treeView()->setHeaderHidden(false);
26  // provide one click editing
27  treeView()->setEditTriggers(QAbstractItemView::AllEditTriggers);
28  treeView()->setAlternatingRowColors(true);
29 }
30 
32 {
33  if (!item) {
34  treeView()->setModel(nullptr);
35  return;
36  }
37 
40  treeView()->setRootIsDecorated(false);
41  treeView()->expandAll();
42 }
43 
Tree view to show items of SessionModel via ViewModel mechanism.
Definition: itemstreeview.h:35
void setViewModel(std::unique_ptr< ViewModel > viewModel)
ViewModel * viewModel() const
void setItem(SessionItem *item)
PropertyTreeView(QWidget *parent=nullptr)
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
SessionModel * model() const
Returns the model to which given item belongs to.
void setRootSessionItem(SessionItem *item)
Definition: viewmodel.cpp:52
MVVM_VIEWMODEL_EXPORT std::unique_ptr< ViewModel > CreatePropertyViewModel(SessionModel *model)
Creates view model to represent SessionModel for Qt views.
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?