BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialeditorwidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/materialeditor/materialeditorwidget.h
6 //! @brief Defines 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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_MATERIALEDITOR_MATERIALEDITORWIDGET_H
16 #define BORNAGAIN_GUI2_MATERIALEDITOR_MATERIALEDITORWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <memory>
21 
22 namespace ModelView {
23 class ViewModel;
24 class ViewModelDelegate;
25 } // namespace ModelView
26 
27 namespace gui2 {
28 
29 class ApplicationModels;
30 class MaterialModel;
31 class MaterialTableView;
32 class MaterialTreeView;
33 class MaterialSelectionModel;
34 
35 //! Widget to hold material table (MaterialTreeView) and all corresponding models and delegates.
36 //! Belongs to MaterialEditor.
37 
38 class DAREFLCORE_EXPORT MaterialEditorWidget : public QWidget {
39  Q_OBJECT
40 
41 public:
42  MaterialEditorWidget(QWidget* parent = nullptr);
44 
45  void setModels(ApplicationModels* models);
46 
47  MaterialSelectionModel* selectionModel() const;
48 
49 private:
50  MaterialModel* m_materialModel{nullptr};
51  std::unique_ptr<ModelView::ViewModel> m_viewModel;
52  MaterialSelectionModel* m_selectionModel{nullptr};
53  MaterialTreeView* m_materialView{nullptr};
54  std::unique_ptr<ModelView::ViewModelDelegate> m_delegate;
55 };
56 
57 } // namespace gui2
58 
59 #endif // BORNAGAIN_GUI2_MATERIALEDITOR_MATERIALEDITORWIDGET_H
Main class to holds all models of GUI session.
Widget to hold material table (MaterialTreeView) and all corresponding models and delegates.
std::unique_ptr< ModelView::ViewModelDelegate > m_delegate
std::unique_ptr< ModelView::ViewModel > m_viewModel
Model to hold MaterialItems.
Definition: materialmodel.h:35
Custom selection model for material view model (AbstractViewModel).
Extension of QTreeView for material editing.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20