20 const QString value_separator =
";";
21 const QString selection_separator =
",";
32 if (!current_value.isEmpty())
46 throw GUIHelpers::Error(
"ComboProperty::setValue() -> Error. Combo doesn't contain "
85 if (index < 0 || index >=
m_values.size())
119 return !(*
this == other);
132 return m_values.join(value_separator);
140 m_values = values.split(value_separator);
149 result.setValue(*
this);
175 if (index < 0 || index >=
m_values.size())
198 text.append(QString::number(index));
199 return text.join(selection_separator);
207 if (values.isEmpty())
210 for (
auto str : values.split(selection_separator)) {
212 int num = str.toInt(&success);
Defines the macro ASSERT.
#define ASSERT(condition)
Defines class ComboProperty.
Defines class GUIHelpers functions.
Custom property to define list of string values with multiple selections.
void setStringOfValues(const QString &values)
Sets values from the string containing delimeter ';'.
QString stringOfSelections() const
Return string with coma separated list of selected indices.
ComboProperty & operator<<(const QString &str)
QStringList getValues() const
bool operator==(const ComboProperty &other) const
void setStringOfSelections(const QString &values)
Sets selected indices from string.
bool operator<(const ComboProperty &other) const
QVector< int > selectedIndices() const
Returns vector of selected indices.
static ComboProperty fromList(const QStringList &values, const QString ¤t_value="")
QVector< int > m_selected_indices
QString stringOfValues() const
Returns a single string containing values delimited with ';'.
QVariant variant() const
Constructs variant enclosing given ComboProperty.
void setSelected(int index, bool value=true)
Sets given index selection flag.
void setValue(const QString &name)
QString label() const
Returns the label to show.
void setToolTips(const QStringList &tooltips)
QStringList selectedValues() const
Returns list of string with selected values;.
bool operator!=(const ComboProperty &other) const
QStringList toolTips() const
returns list of tool tips for all values
void setCurrentIndex(int index)
void setValues(const QStringList &values)
Sets new list of values. Current value will be preserved, if exists in a new list.
QString const & name(EShape k)