BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Base class for all custom variant editors. More...
Public Slots | |
void | setData (const QVariant &data) |
Sets the data from model to editor. More... | |
Signals | |
void | dataChanged (QVariant value) |
Emmits signal when data was changed in an editor. More... | |
Public Member Functions | |
CustomEditor (QWidget *parent=nullptr) | |
QVariant | data () const |
virtual bool | is_persistent () const |
Returns true if editor should remains alive after editing finished. More... | |
Protected Member Functions | |
void | setDataIntern (const QVariant &data) |
Saves the data as given by editor's internal components and notifies the model. More... | |
virtual void | update_components ()=0 |
Should update widget components from m_data, if necessary. More... | |
Protected Attributes | |
QVariant | m_data |
Properties | |
QVariant | value |
Base class for all custom variant editors.
Definition at line 26 of file customeditor.h.
|
explicit |
Definition at line 19 of file customeditor.cpp.
QVariant CustomEditor::data | ( | ) | const |
Definition at line 21 of file customeditor.cpp.
References m_data.
Referenced by setData(), and setDataIntern().
|
signal |
Emmits signal when data was changed in an editor.
Referenced by ModelView::PropertyFlatView::PropertyFlatViewImpl::create_editor(), ModelView::ViewModelDelegate::createEditor(), and setDataIntern().
|
virtual |
Returns true if editor should remains alive after editing finished.
Reimplemented in ModelView::SelectableComboBoxEditor, ModelView::ScientificSpinBoxEditor, ModelView::ComboPropertyEditor, and ModelView::BoolEditor.
Definition at line 28 of file customeditor.cpp.
|
slot |
Sets the data from model to editor.
Definition at line 35 of file customeditor.cpp.
References data(), m_data, and update_components().
|
protected |
Saves the data as given by editor's internal components and notifies the model.
Definition at line 43 of file customeditor.cpp.
References data(), dataChanged(), and m_data.
Referenced by ModelView::ColorEditor::mousePressEvent(), ModelView::BoolEditor::onCheckBoxChange(), ModelView::DoubleEditor::onEditingFinished(), ModelView::IntegerEditor::onEditingFinished(), ModelView::ScientificDoubleEditor::onEditingFinished(), ModelView::ScientificSpinBoxEditor::onEditingFinished(), ModelView::ComboPropertyEditor::onIndexChanged(), ModelView::ExternalPropertyComboEditor::onIndexChanged(), and ModelView::SelectableComboBoxEditor::onModelDataChanged().
|
protectedpure virtual |
Should update widget components from m_data, if necessary.
Implemented in ModelView::SelectableComboBoxEditor, ModelView::ScientificSpinBoxEditor, ModelView::ScientificDoubleEditor, ModelView::IntegerEditor, ModelView::ExternalPropertyEditor, ModelView::ExternalPropertyComboEditor, ModelView::DoubleEditor, ModelView::ComboPropertyEditor, ModelView::ColorEditor, and ModelView::BoolEditor.
Referenced by setData().
|
protected |
Definition at line 48 of file customeditor.h.
Referenced by ModelView::ExternalPropertyEditor::buttonClicked(), ModelView::ColorEditor::currentColor(), data(), ModelView::ComboPropertyEditor::internIndex(), ModelView::ExternalPropertyComboEditor::internIndex(), ModelView::ComboPropertyEditor::internLabels(), ModelView::BoolEditor::onCheckBoxChange(), ModelView::DoubleEditor::onEditingFinished(), ModelView::IntegerEditor::onEditingFinished(), ModelView::ScientificDoubleEditor::onEditingFinished(), ModelView::ScientificSpinBoxEditor::onEditingFinished(), ModelView::ComboPropertyEditor::onIndexChanged(), ModelView::ExternalPropertyComboEditor::onIndexChanged(), ModelView::SelectableComboBoxEditor::onModelDataChanged(), setData(), setDataIntern(), ModelView::BoolEditor::update_components(), ModelView::ColorEditor::update_components(), ModelView::DoubleEditor::update_components(), ModelView::ExternalPropertyEditor::update_components(), ModelView::IntegerEditor::update_components(), ModelView::ScientificDoubleEditor::update_components(), ModelView::ScientificSpinBoxEditor::update_components(), ModelView::SelectableComboBoxEditor::update_components(), and ModelView::SelectableComboBoxEditor::updateBoxLabel().
|
readwrite |
Definition at line 1 of file customeditor.h.
Referenced by ModelView::BoolEditor::onCheckBoxChange(), ModelView::DoubleEditor::setSingleStep(), and ModelView::BoolEditor::update_components().