33 for (QString key : other.
keys()) {
48 QList<QString> keys_list =
m_content.keys();
50 std::sort(keys_list.begin(), keys_list.end());
127 return(!(*
this == dc));
135 foreach (QString key,
keys()) {
136 QDomElement
property = e.ownerDocument().createElement(tag_name);
137 property.setAttribute(
"name", key);
139 QDomText
value = e.ownerDocument().createTextNode(
m_content[key].toString());
140 property.appendChild(
value);
141 e.appendChild(property);
151 if (!property.hasAttribute(
"name"))
continue;
152 addValue(property.attribute(
"name"), QVariant(property.text()));
153 m_content_show.insert(property.attribute(
"name"),
property.attribute(
"show",
"1").toInt());
162 settings.beginWriteArray(array_name);
164 foreach (QString key,
m_content.keys()) {
165 settings.setArrayIndex(i);
166 settings.setValue(
"name", key);
167 settings.setValue(
"value",
m_content[key].toString());
178 int size = settings.beginReadArray(array_name);
179 for (
int i = 0 ; i < size; ++ i) {
180 settings.setArrayIndex(i);
181 QString key = settings.value(
"name").toString();
182 if (key.isEmpty())
continue;
183 addValue(key, settings.value(
"value").toString());
193 return(
"^[a-z0-9-]+$");
200 return (a.length() > b.length());
209 return(re.exactMatch(key));
void fromSettings(QSettings &, const QString &)
static bool stringLongerThan(const QString &, const QString &)
QHash< QString, QVariant > m_content
Diagram context data (key/value pairs)
void add(DiagramContext other)
DiagramContext::add Add all value of to this. If a key already exist, the value is replaced...
void toSettings(QSettings &, const QString &) const
bool operator!=(const DiagramContext &) const
QVariant value(const QString &key) const
QHash< QString, bool > m_content_show
bool addValue(const QString &, const QVariant &, bool show=true)
QList< QString > keys(KeyOrder=None) const
bool contains(const QString &) const
void fromXml(const QDomElement &, const QString &="property")
const QVariant operator[](const QString &) const
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
void toXml(QDomElement &, const QString &="property") const
bool keyMustShow(const QString &) const
DiagramContext::keyMustShow.
bool keyIsAcceptable(const QString &) const
static QString validKeyRegExp()
bool operator==(const DiagramContext &) const