15 #include <QDomElement> 16 #include <QStringList> 22 StringProperty::StringProperty() :
32 retval->mRange = range;
33 retval->mAllowOnlyValuesInRange =
true;
41 retval->mName = name.isEmpty() ? uid : name;
44 retval->mValue = retval->mStore.
readValue(value);
45 retval->mAllowOnlyValuesInRange =
false;
120 if (mDisplayNames.count(
internal))
121 return mDisplayNames[
internal];
127 mDisplayNames = names;
virtual QString convertInternal2Display(QString internal)
conversion from internal value to display value
virtual bool setValue(const QString &value)
set the data value.
virtual void setDisplayName(QString val)
static StringListPropertyPtr initialize(const QString &uid, QString name, QString help, QStringList value, QStringList range, QDomNode root=QDomNode())
Helper class for storing one string value in an xml document.
boost::shared_ptr< class StringProperty > StringPropertyPtr
virtual void setValueRange(QStringList range)
range of value. Use if data is constrained to a set.
virtual QString getUid() const
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
virtual void setHelp(QString val)
Represents one option of the string type. The data are stored within a xml document.
virtual QStringList getValueRange() const
void changed()
emit when the underlying data value is changed: The user interface will be updated.
static StringPropertyPtr initialize(const QString &uid, QString name, QString help, QString value, QStringList range, QDomNode root=QDomNode())
void writeValue(const QString &val)
virtual QString getDisplayName() const
name of data entity. Used for display to user.
void setReadOnly(bool val)
virtual void setDisplayNames(std::map< QString, QString > names)
virtual QString getValue() const
get the data value.
QString readValue(const QString &defval) const
Namespace for all CustusX production code.