BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom editor for QVariant based on double with scientific notation support. 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 | |
ScientificSpinBoxEditor (QWidget *parent=nullptr) | |
QVariant | data () const |
bool | is_persistent () const override |
Returns true if editor should remains alive after editing finished. More... | |
void | setDecimals (int decimals) |
void | setRange (double minimum, double maximum) |
void | setSingleStep (double step) |
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 | onEditingFinished () |
Private Member Functions | |
void | update_components () override |
Should update widget components from m_data, if necessary. More... | |
Private Attributes | |
ScientificSpinBox * | m_doubleEditor |
Custom editor for QVariant based on double with scientific notation support.
Definition at line 26 of file scientificspinboxeditor.h.
|
explicit |
Definition at line 23 of file scientificspinboxeditor.cpp.
References m_doubleEditor, onEditingFinished(), and ModelView::ScientificSpinBox::valueChanged().
|
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().
|
overridevirtual |
Returns true if editor should remains alive after editing finished.
Reimplemented from ModelView::CustomEditor.
Definition at line 60 of file scientificspinboxeditor.cpp.
|
privateslot |
Definition at line 65 of file scientificspinboxeditor.cpp.
References ModelView::Utils::AreAlmostEqual(), ModelView::CustomEditor::m_data, m_doubleEditor, ModelView::CustomEditor::setDataIntern(), and ModelView::ScientificSpinBox::value.
Referenced by ScientificSpinBoxEditor().
|
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(), onEditingFinished(), ModelView::ComboPropertyEditor::onIndexChanged(), ModelView::ExternalPropertyComboEditor::onIndexChanged(), and ModelView::SelectableComboBoxEditor::onModelDataChanged().
void ScientificSpinBoxEditor::setDecimals | ( | int | decimals | ) |
Definition at line 50 of file scientificspinboxeditor.cpp.
References m_doubleEditor, and ModelView::ScientificSpinBox::setDecimals().
void ScientificSpinBoxEditor::setRange | ( | double | minimum, |
double | maximum | ||
) |
Definition at line 44 of file scientificspinboxeditor.cpp.
References m_doubleEditor, ModelView::ScientificSpinBox::setMaximum(), and ModelView::ScientificSpinBox::setMinimum().
void ScientificSpinBoxEditor::setSingleStep | ( | double | step | ) |
Definition at line 55 of file scientificspinboxeditor.cpp.
References m_doubleEditor, and ModelView::ScientificSpinBox::setSingleStep().
|
overrideprivatevirtual |
Should update widget components from m_data, if necessary.
Implements ModelView::CustomEditor.
Definition at line 73 of file scientificspinboxeditor.cpp.
References ModelView::CustomEditor::m_data, m_doubleEditor, and ModelView::ScientificSpinBox::setValue().
|
protectedinherited |
Definition at line 48 of file customeditor.h.
Referenced by ModelView::ExternalPropertyEditor::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(), 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(), ModelView::ExternalPropertyEditor::update_components(), ModelView::IntegerEditor::update_components(), ModelView::ScientificDoubleEditor::update_components(), update_components(), ModelView::SelectableComboBoxEditor::update_components(), and ModelView::SelectableComboBoxEditor::updateBoxLabel().
|
private |
Definition at line 43 of file scientificspinboxeditor.h.
Referenced by ScientificSpinBoxEditor(), onEditingFinished(), setDecimals(), setRange(), setSingleStep(), 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().