BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
importdataeditoractions.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/importdataview/importdataeditoractions.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_IMPORTDATAVIEW_IMPORTDATAEDITORACTIONS_H
16 #define BORNAGAIN_GUI2_IMPORTDATAVIEW_IMPORTDATAEDITORACTIONS_H
17 
18 #include "darefl_export.h"
19 #include <QObject>
20 
21 class QItemSelection;
22 
23 namespace ModelView {
24 class UndoStackInterface;
25 }
26 
27 namespace gui2 {
28 
29 class ExperimentalDataModel;
30 class DataSelectionModel;
31 
32 //! Actions for ImportDataEditor.
33 
34 class DAREFLCORE_EXPORT ImportDataEditorActions : public QObject {
35  Q_OBJECT
36 
37 public:
38  ImportDataEditorActions(ExperimentalDataModel* model, QObject* parent = nullptr);
39 
40  void setSelectionModel(DataSelectionModel* selection_model);
41 
42  bool isUndoEnabled() const;
43 
44 signals:
46 
47 public slots:
48  void onAddCanvas();
49  void onMergeCanvases();
50  void onDeleteItem();
51  void onUndo();
52  void onRedo();
53  void onImportDialogRequest();
54 
55 private slots:
56  void onSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
57 
58 private:
59  ModelView::UndoStackInterface* undoStack() const;
60 
61  ExperimentalDataModel* m_dataModel{nullptr};
62  DataSelectionModel* m_selectionModel{nullptr};
63 };
64 
65 } // namespace gui2
66 
67 #endif // BORNAGAIN_GUI2_IMPORTDATAVIEW_IMPORTDATAEDITORACTIONS_H
Interface class for undo/redo stack.
Custom selection model for data view model (AbstractViewModel).
The model to store imported reflectometry data.
Actions for ImportDataEditor.
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