BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Custom property to define list of string values with multiple selections. Intended for QVariant.
Definition at line 25 of file ComboProperty.h.
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. If false, index will be excluded from selection. 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 |
|
default |
|
private |
Definition at line 28 of file ComboProperty.cpp.
int ComboProperty::currentIndex | ( | ) | const |
Definition at line 83 of file ComboProperty.cpp.
References m_selected_indices.
Referenced by getValue(), and ComboPropertyEditor::internIndex().
|
static |
Definition at line 33 of file ComboProperty.cpp.
References setValue().
Referenced by DataItem::DataItem().
QString ComboProperty::getValue | ( | ) | const |
Definition at line 43 of file ComboProperty.cpp.
References currentIndex(), and m_values.
Referenced by IntensityDataCanvas::applyPersistentSettings(), IntensityDataItem::getGradientValue(), label(), FitParameterItem::parameterType(), setStringOfValues(), and setValues().
QStringList ComboProperty::getValues | ( | ) | const |
Definition at line 57 of file ComboProperty.cpp.
References m_values.
Referenced by ComboPropertyEditor::internLabels().
QString ComboProperty::label | ( | ) | const |
Returns the label to show.
Definition at line 225 of file ComboProperty.cpp.
References getValue(), and m_selected_indices.
bool ComboProperty::operator!= | ( | const ComboProperty & | other | ) | const |
Definition at line 122 of file ComboProperty.cpp.
References other.
bool ComboProperty::operator< | ( | const ComboProperty & | other | ) | const |
Definition at line 127 of file ComboProperty.cpp.
References m_selected_indices, m_values, and other.
ComboProperty & ComboProperty::operator<< | ( | const QString & | str | ) |
Definition at line 97 of file ComboProperty.cpp.
References m_values, and setCurrentIndex().
ComboProperty & ComboProperty::operator<< | ( | const QStringList & | str | ) |
Definition at line 105 of file ComboProperty.cpp.
References m_values, and setCurrentIndex().
bool ComboProperty::operator== | ( | const ComboProperty & | other | ) | const |
Definition at line 113 of file ComboProperty.cpp.
References m_selected_indices, m_values, and other.
QVector< int > ComboProperty::selectedIndices | ( | ) | const |
Returns vector of selected indices.
Definition at line 160 of file ComboProperty.cpp.
References m_selected_indices.
QStringList ComboProperty::selectedValues | ( | ) | const |
Returns list of string with selected values;.
Definition at line 167 of file ComboProperty.cpp.
References m_selected_indices, and m_values.
void ComboProperty::setCurrentIndex | ( | int | index | ) |
Definition at line 88 of file ComboProperty.cpp.
References Error, m_selected_indices, and m_values.
Referenced by SelectionDescriptor< T >::SelectionDescriptor(), GroupItemController::createCombo(), ComboPropertyEditor::onIndexChanged(), operator<<(), setStringOfValues(), setValue(), and setValues().
void ComboProperty::setSelected | ( | const QString & | name, |
bool | value = true |
||
) |
Definition at line 192 of file ComboProperty.cpp.
References m_values, GUI::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 178 of file ComboProperty.cpp.
References m_selected_indices, and m_values.
Referenced by setSelected(), and setStringOfSelections().
void ComboProperty::setStringOfSelections | ( | const QString & | values | ) |
Sets selected indices from string.
Definition at line 209 of file ComboProperty.cpp.
References m_selected_indices, and setSelected().
Referenced by GUI::Session::XML::readProperty().
void ComboProperty::setStringOfValues | ( | const QString & | values | ) |
Sets values from the string containing delimeter ';'.
Definition at line 142 of file ComboProperty.cpp.
References getValue(), m_values, and setCurrentIndex().
Referenced by GUI::Session::XML::readProperty().
void ComboProperty::setToolTips | ( | const QStringList & | tooltips | ) |
Definition at line 78 of file ComboProperty.cpp.
References m_tooltips.
Referenced by MinimizerItemCatalog::algorithmCombo().
void ComboProperty::setValue | ( | const QString & | name | ) |
Definition at line 48 of file ComboProperty.cpp.
References Error, m_values, GUI::RealSpace::Particles::name(), and setCurrentIndex().
Referenced by MinimizerContainerItem::MinimizerContainerItem(), IntensityDataCanvas::applyPersistentSettings(), GUI::Model::JobItemUtils::availableUnits(), and fromList().
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 64 of file ComboProperty.cpp.
References 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 199 of file ComboProperty.cpp.
References m_selected_indices.
QString ComboProperty::stringOfValues | ( | ) | const |
Returns a single string containing values delimited with ';'.
Definition at line 135 of file ComboProperty.cpp.
References m_values.
QStringList ComboProperty::toolTips | ( | ) | const |
Returns list of tool tips for all values.
Definition at line 73 of file ComboProperty.cpp.
References m_tooltips.
QVariant ComboProperty::variant | ( | ) | const |
Constructs variant enclosing given ComboProperty.
Definition at line 151 of file ComboProperty.cpp.
Referenced by MinimizerContainerItem::MinimizerContainerItem(), GroupItemController::createCombo(), GUI::Session::XML::readProperty(), Data1DViewItem::setAxesUnits(), and DataItem::setAxesUnits().
|
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().