36 #include <QDomElement> 37 #include <QStringList> 43 StringListProperty::StringListProperty()
50 retval->mName = name.isEmpty() ? uid : name;
53 retval->mValue = retval->mStore.
readVariant(value).value<QStringList>();
54 retval->mRange = range;
95 this->
setValue(val.value<QStringList>());
110 for (
int i=0; i<val.size(); ++i)
111 if (mRange.contains(val[i]))
112 mValue.push_back(val[i]);
135 if (mDisplayNames.count(
internal))
136 return mDisplayNames[
internal];
142 mDisplayNames = names;
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
void writeVariant(const QVariant &val)
Represents one collection of strings.
virtual void setDisplayName(QString val)
static StringListPropertyPtr initialize(const QString &uid, QString name, QString help, QStringList value, QStringList range, QDomNode root=QDomNode())
virtual void setValueRange(QStringList range)
range that values can be selected from
virtual QVariant getValueAsVariant() const
Helper class for storing one string value in an xml document.
virtual void setHelp(QString val)
virtual bool setValue(const QStringList &value)
set the data value.
virtual void setDisplayNames(std::map< QString, QString > names)
virtual QStringList getValue() const
get the data value.
virtual QString convertInternal2Display(QString internal)
conversion from internal value to display value
virtual QStringList getValueRange() const
void changed()
emit when the underlying data value is changed: The user interface will be updated.
boost::shared_ptr< class StringListProperty > StringListPropertyPtr
virtual QString getDisplayName() const
name of data entity. Used for display to user.
QVariant readVariant(const QVariant &defval=QVariant()) const
virtual void setValueFromVariant(QVariant val)
virtual QString getUid() const
Namespace for all CustusX production code.