36 #include <QDomElement>
37 #include <QStringList>
43 StringProperty::StringProperty() :
53 retval->mRange = range;
54 retval->mAllowOnlyValuesInRange =
true;
62 retval->mName = name.isEmpty() ? uid : name;
65 retval->mValue = retval->mStore.
readValue(value);
66 retval->mAllowOnlyValuesInRange =
false;
141 if (mDisplayNames.count(
internal))
142 return mDisplayNames[
internal];
148 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)
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