36 #include <QDomElement>
37 #include <QStringList>
43 StringProperty::StringProperty() : mIsReadOnly(false)
51 StringPropertyPtr StringProperty::initialize(
const QString& uid, QString name, QString help, QString value, QStringList range, QDomNode root)
55 retval->mName = name.isEmpty() ? uid : name;
57 retval->mRange = range;
59 retval->mValue = retval->mStore.
readValue(value);
60 retval->mAllowOnlyValuesInRange =
true;
64 StringPropertyPtr StringProperty::initialize(
const QString& uid, QString name, QString help, QString value, QDomNode root)
68 retval->mName = name.isEmpty() ? uid : name;
72 retval->mValue = retval->mStore.
readValue(value);
73 retval->mAllowOnlyValuesInRange =
false;
77 void StringProperty::setReadOnly(
bool val)
83 QString StringProperty::getDisplayName()
const
88 QString StringProperty::getUid()
const
93 QString StringProperty::getHelp()
const
98 void StringProperty::setHelp(QString val)
108 QString StringProperty::getValue()
const
113 bool StringProperty::setValue(
const QString& val)
119 mStore.writeValue(val);
125 QStringList StringProperty::getValueRange()
const
130 void StringProperty::setValueRange(QStringList range)
139 QString StringProperty::convertInternal2Display(QString
internal)
141 if (mDisplayNames.count(
internal))
142 return mDisplayNames[
internal];
146 void StringProperty::setDisplayNames(std::map<QString, QString> names)
148 mDisplayNames = names;
Helper class for storing one string value in an xml document.
boost::shared_ptr< class StringProperty > StringPropertyPtr
Represents one option of the string type. The data are stored within a xml document.
QString readValue(const QString &defval) const