BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
layerselectionmodel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/layereditor/layerselectionmodel.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_LAYERSELECTIONMODEL_H
16 #define BORNAGAIN_GUI2_LAYEREDITOR_LAYERSELECTIONMODEL_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 LayerEditorActions;
30 
31 //! Custom selection model for layer view model (AbstractViewModel).
32 
33 class DAREFLCORE_EXPORT LayerSelectionModel : public QItemSelectionModel {
34  Q_OBJECT
35 
36 public:
37  LayerSelectionModel(ModelView::ViewModel* view_model, QObject* parent = nullptr);
38  ~LayerSelectionModel() = default;
39 
40  void selectItems(std::vector<ModelView::SessionItem*> items);
41  void selectItem(ModelView::SessionItem* item);
42  bool firstSelected() const;
43  bool lastSelected() const;
44 
45  std::vector<ModelView::SessionItem*> selectedItems() const;
46 
47  const ModelView::ViewModel* viewModel() const;
48 };
49 
50 } // namespace gui2
51 
52 #endif // BORNAGAIN_GUI2_LAYEREDITOR_LAYERSELECTIONMODEL_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 layer 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