|
BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom property to define list of string values with multiple selections. More...
Public Member Functions | |
| ComboProperty () | |
| int | currentIndex () const |
| QString | getValue () const |
| QStringList | getValues () const |
| QString | label () const |
| Returns the label to show. More... | |
| bool | operator!= (const ComboProperty &other) const |
| bool | operator< (const ComboProperty &other) const |
| ComboProperty & | operator<< (const QString &str) |
| ComboProperty & | operator<< (const QStringList &str) |
| bool | operator== (const ComboProperty &other) const |
| QVector< int > | selectedIndices () const |
| Returns vector of selected indices. More... | |
| QStringList | selectedValues () const |
| Returns list of string with selected values;. More... | |
| void | setCurrentIndex (int index) |
| void | setSelected (const QString &name, bool value=true) |
| void | setSelected (int index, bool value=true) |
| Sets given index selection flag. More... | |
| void | setStringOfSelections (const QString &values) |
| Sets selected indices from string. More... | |
| void | setStringOfValues (const QString &values) |
| Sets values from the string containing delimeter ';'. More... | |
| void | setToolTips (const QStringList &tooltips) |
| void | setValue (const QString &name) |
| void | setValues (const QStringList &values) |
| Sets new list of values. Current value will be preserved, if exists in a new list. More... | |
| QString | stringOfSelections () const |
| Return string with coma separated list of selected indices. More... | |
| QString | stringOfValues () const |
| Returns a single string containing values delimited with ';'. More... | |
| QStringList | toolTips () const |
| returns list of tool tips for all values More... | |
| QVariant | variant () const |
| Constructs variant enclosing given ComboProperty. More... | |
Static Public Member Functions | |
| static ComboProperty | fromList (const QStringList &values, const QString ¤t_value="") |
Private Member Functions | |
| ComboProperty (QStringList values) | |
Private Attributes | |
| QVector< int > | m_selected_indices |
| QStringList | m_tooltips |
| QStringList | m_values |
Custom property to define list of string values with multiple selections.
Intended for QVariant.
Definition at line 25 of file ComboProperty.h.
|
default |
|
private |
Definition at line 26 of file ComboProperty.cpp.
| int ComboProperty::currentIndex | ( | ) | const |
Definition at line 78 of file ComboProperty.cpp.
References m_selected_indices.
Referenced by getValue(), ComboPropertyEditor::internIndex(), and ComboPropertyEditor::onIndexChanged().
|
static |
Definition at line 28 of file ComboProperty.cpp.
References setValue().
Referenced by ParticleDistributionItem::updateLinkedParameterList(), and ParticleDistributionItem::updateMainParameterList().
| QString ComboProperty::getValue | ( | ) | const |
Definition at line 38 of file ComboProperty.cpp.
References currentIndex(), and m_values.
Referenced by SimulationOptionsItem::SimulationOptionsItem(), IntensityDataCanvas::applyPersistentSettings(), DomainObjectBuilder::buildParticleLayout(), RectangularDetectorItem::createDomainDetector(), SimulationOptionsItem::getComputationMethod(), SimulationOptionsItem::getFresnelMaterialMethod(), IntensityDataItem::getGradient(), SimulationOptionsItem::getIncludeSpecularPeak(), SimulationOptionsItem::getNumberOfThreads(), RectangularDetectorEditor::init_alignment_editors(), label(), FitParameterItem::parameterType(), SimulationOptionsItem::runPolicy(), DataItem::selectedAxesUnits(), setStringOfValues(), setValues(), RectangularDetectorItem::update_properties_appearance(), and SimulationOptionsItem::updateComboItem().
| QStringList ComboProperty::getValues | ( | ) | const |
Definition at line 52 of file ComboProperty.cpp.
References m_values.
Referenced by ComboPropertyEditor::internLabels(), RectangularDetectorItem::setDetectorAlignment(), SimulationOptionsItem::updateComboItem(), and ParticleDistributionItem::updateMainParameterList().
| QString ComboProperty::label | ( | ) | const |
Returns the label to show.
Definition at line 220 of file ComboProperty.cpp.
References getValue(), and m_selected_indices.
Referenced by MultiComboPropertyEditor::updateBoxLabel().
| bool ComboProperty::operator!= | ( | const ComboProperty & | other | ) | const |
Definition at line 117 of file ComboProperty.cpp.
| bool ComboProperty::operator< | ( | const ComboProperty & | other | ) | const |
| ComboProperty & ComboProperty::operator<< | ( | const QString & | str | ) |
Definition at line 92 of file ComboProperty.cpp.
References m_values, and setCurrentIndex().
| ComboProperty & ComboProperty::operator<< | ( | const QStringList & | str | ) |
Definition at line 100 of file ComboProperty.cpp.
References m_values, and setCurrentIndex().
| bool ComboProperty::operator== | ( | const ComboProperty & | other | ) | const |
| QVector< int > ComboProperty::selectedIndices | ( | ) | const |
Returns vector of selected indices.
Definition at line 155 of file ComboProperty.cpp.
References m_selected_indices.
| QStringList ComboProperty::selectedValues | ( | ) | const |
Returns list of string with selected values;.
Definition at line 162 of file ComboProperty.cpp.
References m_selected_indices, and m_values.
Referenced by ParticleDistributionItem::updateLinkedParameterList().
| void ComboProperty::setCurrentIndex | ( | int | index | ) |
Definition at line 83 of file ComboProperty.cpp.
References m_selected_indices, and m_values.
Referenced by GroupItemController::createCombo(), ComboPropertyEditor::onIndexChanged(), operator<<(), setStringOfValues(), setValue(), and setValues().
| void ComboProperty::setSelected | ( | const QString & | name, |
| bool | value = true |
||
| ) |
Definition at line 187 of file ComboProperty.cpp.
References m_values, RealSpace::Particles::name(), and setSelected().
| void ComboProperty::setSelected | ( | int | index, |
| bool | value = true |
||
| ) |
Sets given index selection flag.
If false, index will be excluded from selection.
Definition at line 173 of file ComboProperty.cpp.
References m_selected_indices, and m_values.
Referenced by MultiComboPropertyEditor::onModelDataChanged(), setSelected(), setStringOfSelections(), and ParticleDistributionItem::updateLinkedParameterList().
| void ComboProperty::setStringOfSelections | ( | const QString & | values | ) |
Sets selected indices from string.
Definition at line 204 of file ComboProperty.cpp.
References m_selected_indices, and setSelected().
Referenced by SessionXML::readProperty().
| void ComboProperty::setStringOfValues | ( | const QString & | values | ) |
Sets values from the string containing delimeter ';'.
Definition at line 137 of file ComboProperty.cpp.
References getValue(), m_values, and setCurrentIndex().
Referenced by SessionXML::readProperty().
| void ComboProperty::setToolTips | ( | const QStringList & | tooltips | ) |
Definition at line 73 of file ComboProperty.cpp.
References m_tooltips.
Referenced by SimulationOptionsItem::SimulationOptionsItem(), and MinimizerItemCatalog::algorithmCombo().
| void ComboProperty::setValue | ( | const QString & | name | ) |
Definition at line 43 of file ComboProperty.cpp.
References m_values, RealSpace::Particles::name(), and setCurrentIndex().
Referenced by MinimizerContainerItem::MinimizerContainerItem(), IntensityDataCanvas::applyPersistentSettings(), JobItemUtils::availableUnits(), fromList(), SimulationOptionsItem::setComputationMethod(), RectangularDetectorItem::setDetectorAlignment(), SimulationOptionsItem::setFresnelMaterialMethod(), SimulationOptionsItem::setIncludeSpecularPeak(), SimulationOptionsItem::setRunPolicy(), SimulationOptionsItem::updateComboItem(), and ParticleDistributionItem::updateMainParameterList().
| void ComboProperty::setValues | ( | const QStringList & | values | ) |
Sets new list of values. Current value will be preserved, if exists in a new list.
Definition at line 59 of file ComboProperty.cpp.
References ASSERT, getValue(), m_values, and setCurrentIndex().
Referenced by GroupItemController::createCombo().
| QString ComboProperty::stringOfSelections | ( | ) | const |
Return string with coma separated list of selected indices.
Definition at line 194 of file ComboProperty.cpp.
References m_selected_indices.
Referenced by SessionXML::writeVariant().
| QString ComboProperty::stringOfValues | ( | ) | const |
Returns a single string containing values delimited with ';'.
Definition at line 130 of file ComboProperty.cpp.
References m_values.
Referenced by SessionXML::writeVariant().
| QStringList ComboProperty::toolTips | ( | ) | const |
returns list of tool tips for all values
Definition at line 68 of file ComboProperty.cpp.
References m_tooltips.
| QVariant ComboProperty::variant | ( | ) | const |
Constructs variant enclosing given ComboProperty.
Definition at line 146 of file ComboProperty.cpp.
Referenced by Data1DViewItem::Data1DViewItem(), DataItem::DataItem(), MinimizerContainerItem::MinimizerContainerItem(), ParticleDistributionItem::ParticleDistributionItem(), SimulationOptionsItem::SimulationOptionsItem(), IntensityDataCanvas::applyPersistentSettings(), GroupItemController::createCombo(), QREDataLoader::createOutputDataFromParsingResult(), JobModelFunctions::initDataView(), SessionXML::readProperty(), IntensityDataItem::reset(), SpecularDataItem::reset(), SimulationOptionsItem::setComputationMethod(), RectangularDetectorItem::setDetectorAlignment(), SimulationOptionsItem::setFresnelMaterialMethod(), SimulationOptionsItem::setIncludeSpecularPeak(), JobItemUtils::setIntensityItemAxesUnits(), SimulationOptionsItem::setRunPolicy(), SimulationOptionsItem::updateComboItem(), ParticleDistributionItem::updateLinkedParameterList(), and ParticleDistributionItem::updateMainParameterList().
|
private |
Definition at line 70 of file ComboProperty.h.
Referenced by currentIndex(), label(), operator<(), operator==(), selectedIndices(), selectedValues(), setCurrentIndex(), setSelected(), setStringOfSelections(), and stringOfSelections().
|
private |
Definition at line 69 of file ComboProperty.h.
Referenced by setToolTips(), and toolTips().
|
private |
Definition at line 68 of file ComboProperty.h.
Referenced by getValue(), getValues(), operator<(), operator<<(), operator==(), selectedValues(), setCurrentIndex(), setSelected(), setStringOfValues(), setValue(), setValues(), and stringOfValues().