BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
customeditor.cpp
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/viewmodel/mvvm/editors/customeditor.cpp
6 //! @brief Implements 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 
16 
17 using namespace ModelView;
18 
19 CustomEditor::CustomEditor(QWidget* parent) : QWidget(parent) {}
20 
21 QVariant CustomEditor::data() const
22 {
23  return m_data;
24 }
25 
26 //! Returns true if editor should remains alive after editing finished.
27 
29 {
30  return false;
31 }
32 
33 //! Sets the data from model to editor.
34 
35 void CustomEditor::setData(const QVariant& data)
36 {
37  m_data = data;
39 }
40 
41 //! Saves the data as given by editor's internal components and notifies the model.
42 
43 void CustomEditor::setDataIntern(const QVariant& data)
44 {
45  m_data = data;
47 }
void dataChanged(QVariant value)
Emmits signal when data was changed in an editor.
virtual bool is_persistent() const
Returns true if editor should remains alive after editing finished.
void setData(const QVariant &data)
Sets the data from model to editor.
CustomEditor(QWidget *parent=nullptr)
QVariant data() const
virtual void update_components()=0
Should update widget components from m_data, if necessary.
void setDataIntern(const QVariant &data)
Saves the data as given by editor's internal components and notifies the model.
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.