15 #include <QDomElement> 16 #include <QStringList> 22 StringListProperty::StringListProperty()
29 retval->mName = name.isEmpty() ? uid : name;
32 retval->mValue = retval->mStore.
readVariant(value).value<QStringList>();
33 retval->mRange = range;
74 this->
setValue(val.value<QStringList>());
89 for (
int i=0; i<val.size(); ++i)
90 if (mRange.contains(val[i]))
91 mValue.push_back(val[i]);
114 if (mDisplayNames.count(
internal))
115 return mDisplayNames[
internal];
121 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.