BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
layereditorwidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/layereditor/layereditorwidget.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_LAYEREDITOR_LAYEREDITORWIDGET_H
16 #define BORNAGAIN_GUI2_LAYEREDITOR_LAYEREDITORWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <memory>
21 
22 namespace ModelView {
23 class ViewModelDelegate;
24 } // namespace ModelView
25 
26 namespace gui2 {
27 
28 class ApplicationModels;
29 class LayerTreeView;
30 class LayerSelectionModel;
31 class LayerViewModel;
32 
33 //! Widget to hold layer tree (LayerTreeView) and all corresponding models and delegates.
34 //! Belongs to LayerEditor.
35 
36 class DAREFLCORE_EXPORT LayerEditorWidget : public QWidget {
37  Q_OBJECT
38 
39 public:
40  LayerEditorWidget(QWidget* parent = nullptr);
42 
43  void setModels(ApplicationModels* models);
44 
45  LayerSelectionModel* selectionModel() const;
46 
47 private:
48  std::unique_ptr<LayerViewModel> m_viewModel;
49  LayerSelectionModel* m_selectionModel{nullptr};
50  LayerTreeView* m_layerView{nullptr};
51  std::unique_ptr<ModelView::ViewModelDelegate> m_delegate;
52 };
53 
54 } // namespace gui2
55 
56 #endif // BORNAGAIN_GUI2_LAYEREDITOR_LAYEREDITORWIDGET_H
Main class to holds all models of GUI session.
Widget to hold layer tree (LayerTreeView) and all corresponding models and delegates.
std::unique_ptr< LayerViewModel > m_viewModel
std::unique_ptr< ModelView::ViewModelDelegate > m_delegate
Custom selection model for layer view model (AbstractViewModel).
Extension of QTreeView for layer editing.
Definition: layertreeview.h:25
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