BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
setvaluecommand.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/setvaluecommand.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_SETVALUECOMMAND_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_SETVALUECOMMAND_H
17 
19 #include "mvvm/core/variant.h"
20 
21 namespace ModelView {
22 
23 class SessionItem;
24 
25 //! Command for unddo/redo framework to set the data of SessionItem.
26 
27 class MVVM_MODEL_EXPORT SetValueCommand : public AbstractItemCommand {
28 public:
29  SetValueCommand(SessionItem* item, Variant value, int role);
30  ~SetValueCommand() override;
31 
32 private:
33  void undo_command() override;
34  void execute_command() override;
35  void swap_values();
36 
37  struct SetValueCommandImpl;
38  std::unique_ptr<SetValueCommandImpl> p_impl;
39 };
40 
41 } // namespace ModelView
42 
43 #endif // BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_SETVALUECOMMAND_H
Defines class CLASS?
Abstract command interface to manipulate SessionItem in model context.
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Command for unddo/redo framework to set the data of SessionItem.
std::unique_ptr< SetValueCommandImpl > p_impl
materialitems.h Collection of materials to populate MaterialModel.
Defines class CLASS?
QVariant Variant
Definition: variant.h:23