45 settings.setValue(
prefix +
"displayhas", display);
47 settings.setValue(
prefix +
"snapto", snap);
51 settings.setValue(
prefix +
"master_label", master_label);
53 settings.setValue(
prefix +
"slave_label", slave_label);
54 foreach (QString key,
m_prefix.keys()) {
67 QString display = settings.value(
prefix +
"displayhas",
"cross").toString();
69 QString snap = settings.value(
prefix +
"snapto",
"label").toString();
75 m_prefix.insert(key, settings.value(
prefix + key +
"prefix").toString());
85 xml_element.setAttribute(
"showpowerctc",
m_show_power_ctc?
"true" :
"false");
87 xml_element.setAttribute(
"displayhas", display);
89 xml_element.setAttribute(
"snapto", snap);
91 xml_element.setAttribute(
"offset", QString::number(
offset));
93 xml_element.setAttribute(
"master_label", master_label);
95 xml_element.setAttribute(
"slave_label", slave_label);
96 foreach (QString key,
m_prefix.keys()) {
97 xml_element.setAttribute(key +
"prefix",
m_prefix.value(key));
108 QString display = xml_element.attribute(
"displayhas",
"cross");
110 QString snap = xml_element.attribute(
"snapto",
"label");
112 m_offset = xml_element.attribute(
"offset",
"0").toInt();
113 m_master_label = xml_element.attribute(
"master_label",
"%f-%l%c");
114 m_slave_label = xml_element.attribute(
"slave_label",
"(%f-%l%c)");
116 m_prefix.insert(key, xml_element.attribute(key +
"prefix"));
129 QHash <QString, XRefProperties> hash;
131 keys <<
"coil" <<
"protection" <<
"commutator";
135 foreach (QString key, keys)
138 QString str(
"diagrameditor/defaultxref");
140 hash.insert(key, properties);
157 return (! (*
this == xrp));
QString prefix(const QString &key) const
The XRefProperties class this class store properties used by XrefItem.
void fromSettings(const QSettings &settings, const QString=QString()) override
XRefProperties::fromSettings load from settings.
QHash< QString, QString > m_prefix
static QHash< QString, XRefProperties > defaultProperties()
XRefProperties::defaultProperties.
void toSettings(QSettings &settings, const QString=QString()) const override
XRefProperties::toSettings Save to settings.
bool operator==(const XRefProperties &xrp) const
void toXml(QDomElement &xml_element) const override
XRefProperties::toXml Save to xml.
void fromXml(const QDomElement &xml_element) override
XRefProperties::fromXml Load from xml.
XRefProperties()
XRefProperties::XRefProperties Default Constructor.
bool operator!=(const XRefProperties &xrp) const
QStringList m_prefix_keys