BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
commandadapter.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/model/mvvm/commands/commandadapter.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 Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_COMMANDADAPTER_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_COMMANDADAPTER_H
17 
18 #include "mvvm/model_export.h"
19 #include <QUndoCommand>
20 #include <memory>
21 
22 namespace ModelView {
23 
24 class AbstractItemCommand;
25 
26 //! Adapter to execute our commands within Qt undo/redo framework.
27 
28 class MVVM_MODEL_EXPORT CommandAdapter : public QUndoCommand {
29 public:
30  CommandAdapter(std::shared_ptr<AbstractItemCommand> command);
31  ~CommandAdapter() override;
32 
33  void undo() override;
34  void redo() override;
35 
36 private:
37  std::shared_ptr<AbstractItemCommand> m_command;
38 };
39 
40 } // namespace ModelView
41 
42 #endif // BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_COMMANDADAPTER_H
Adapter to execute our commands within Qt undo/redo framework.
std::shared_ptr< AbstractItemCommand > m_command
materialitems.h Collection of materials to populate MaterialModel.