BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialselectionmodel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/materialeditor/materialselectionmodel.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_MATERIALSELECTIONMODEL_H
16 #define BORNAGAIN_GUI2_MATERIALEDITOR_MATERIALSELECTIONMODEL_H
17 
18 #include "darefl_export.h"
19 #include <QItemSelectionModel>
20 #include <vector>
21 
22 namespace ModelView {
23 class ViewModel;
24 class SessionItem;
25 } // namespace ModelView
26 
27 namespace gui2 {
28 
29 class MaterialEditorActions;
30 class MaterialBaseItem;
31 
32 //! Custom selection model for material view model (AbstractViewModel).
33 //! Reports clients about selected MaterialItem in material table and hides
34 //! QModelIndex related machinery.
35 
36 class DAREFLCORE_EXPORT MaterialSelectionModel : public QItemSelectionModel {
37  Q_OBJECT
38 
39 public:
40  MaterialSelectionModel(ModelView::ViewModel* view_model, QObject* parent = nullptr);
42 
43  void selectItem(ModelView::SessionItem* item);
44  void selectItems(std::vector<ModelView::SessionItem*> items);
45 
46  std::vector<MaterialBaseItem*> selectedMaterials() const;
47 
48  const ModelView::ViewModel* viewModel() const;
49 };
50 
51 } // namespace gui2
52 
53 #endif // BORNAGAIN_GUI2_MATERIALEDITOR_MATERIALSELECTIONMODEL_H
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Main class to represent content of SessionModel in Qt's trees and tables.
Definition: viewmodel.h:29
Custom selection model for material view model (AbstractViewModel).
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