BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom editor for QVariant based on ExternalProperty. 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 | |
ExternalPropertyEditor (QWidget *parent=nullptr) | |
QVariant | data () const |
virtual bool | is_persistent () const |
Returns true if editor should remains alive after editing finished. More... | |
void | setCallback (std::function< void(const QVariant &)> callback) |
Protected Member Functions | |
void | setDataIntern (const QVariant &data) |
Saves the data as given by editor's internal components and notifies the model. More... | |
Protected Attributes | |
QVariant | m_data |
Properties | |
QVariant | value |
Private Slots | |
void | buttonClicked () |
Private Member Functions | |
void | update_components () override |
Should update widget components from m_data, if necessary. More... | |
Private Attributes | |
std::function< void(const QVariant &)> | m_callback |
LostFocusFilter * | m_focusFilter |
QLabel * | m_pixmapLabel |
QLabel * | m_textLabel |
Custom editor for QVariant based on ExternalProperty.
Contains icon, label and button to call external dialog via callback mechanism.
Definition at line 30 of file externalpropertyeditor.h.
|
explicit |
Definition at line 28 of file externalpropertyeditor.cpp.
References buttonClicked(), m_pixmapLabel, and m_textLabel.
|
privateslot |
Definition at line 61 of file externalpropertyeditor.cpp.
References m_callback, ModelView::CustomEditor::m_data, and GUIHelpers::warning().
Referenced by ExternalPropertyEditor().
|
inherited |
Definition at line 21 of file customeditor.cpp.
References ModelView::CustomEditor::m_data.
Referenced by ModelView::CustomEditor::setData(), and ModelView::CustomEditor::setDataIntern().
|
signalinherited |
Emmits signal when data was changed in an editor.
Referenced by ModelView::PropertyFlatView::PropertyFlatViewImpl::create_editor(), ModelView::ViewModelDelegate::createEditor(), and ModelView::CustomEditor::setDataIntern().
|
virtualinherited |
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.
void ExternalPropertyEditor::setCallback | ( | std::function< void(const QVariant &)> | callback | ) |
Definition at line 56 of file externalpropertyeditor.cpp.
References m_callback.
|
slotinherited |
Sets the data from model to editor.
Definition at line 35 of file customeditor.cpp.
References ModelView::CustomEditor::data(), ModelView::CustomEditor::m_data, and ModelView::CustomEditor::update_components().
|
protectedinherited |
Saves the data as given by editor's internal components and notifies the model.
Definition at line 43 of file customeditor.cpp.
References ModelView::CustomEditor::data(), ModelView::CustomEditor::dataChanged(), and ModelView::CustomEditor::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().
|
overrideprivatevirtual |
Should update widget components from m_data, if necessary.
Implements ModelView::CustomEditor.
Definition at line 69 of file externalpropertyeditor.cpp.
References ModelView::Style::DefaultPixmapSize(), ModelView::Utils::IsExtPropertyVariant(), ModelView::CustomEditor::m_data, m_pixmapLabel, and m_textLabel.
|
private |
Definition at line 46 of file externalpropertyeditor.h.
Referenced by buttonClicked(), and setCallback().
|
protectedinherited |
Definition at line 48 of file customeditor.h.
Referenced by buttonClicked(), ModelView::ColorEditor::currentColor(), ModelView::CustomEditor::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(), ModelView::CustomEditor::setData(), ModelView::CustomEditor::setDataIntern(), ModelView::BoolEditor::update_components(), ModelView::ColorEditor::update_components(), ModelView::DoubleEditor::update_components(), update_components(), ModelView::IntegerEditor::update_components(), ModelView::ScientificDoubleEditor::update_components(), ModelView::ScientificSpinBoxEditor::update_components(), ModelView::SelectableComboBoxEditor::update_components(), and ModelView::SelectableComboBoxEditor::updateBoxLabel().
|
private |
Definition at line 45 of file externalpropertyeditor.h.
|
private |
Definition at line 44 of file externalpropertyeditor.h.
Referenced by ExternalPropertyEditor(), and update_components().
|
private |
Definition at line 43 of file externalpropertyeditor.h.
Referenced by ExternalPropertyEditor(), and update_components().
|
readwriteinherited |
Definition at line 1 of file customeditor.h.
Referenced by ModelView::BoolEditor::onCheckBoxChange(), ModelView::DoubleEditor::setSingleStep(), and ModelView::BoolEditor::update_components().