51 if (!
keyIsAcceptable(type) && !value.canConvert(QVariant::String))
return false;
52 if (
keyIsNumber(type) && !value.canConvert(QVariant::Int))
return false;
54 QString valuestr = value.toString();
56 content_ << type +
"|" + valuestr +
"|" + QString::number(increase) +
"|" + QString::number(initialvalue);
72 for (
int i=0; i<other.
size(); ++i)
content_.append(other[i]);
88 if (
content_.size() > 0)
return false;
104 return (
"unit|unitfolio|ten|tenfolio|hundred|hundredfolio|string|idfolio|folio|plant|locmach|elementline|elementcolumn|elementprefix");
112 return (
"unit|unitfolio|ten|tenfolio|hundred|hundredfolio");
136 QDomElement num_auto = d.createElement(str);
137 for (
int i=0; i<
content_.size(); ++i) {
138 QStringList strl =
itemAt(i);
139 QDomElement part = d.createElement(
"part");
140 part.setAttribute(
"type", strl.at(0));
141 part.setAttribute(
"value", strl.at(1));
142 part.setAttribute(
"increase", strl.at(2));
143 if (strl.at(0) == (
"unitfolio") ||
144 strl.at(0) == (
"tenfolio") ||
145 strl.at(0) == (
"hundredfolio")) {
146 part.setAttribute(
"initialvalue", strl.at(3));
148 num_auto.appendChild(part);
159 foreach(QDomElement qde,
QET::findInDomElement(e,
"part"))
addValue(qde.attribute(
"type"), qde.attribute(
"value"), qde.attribute(
"increase").toInt(), qde.attribute(
"initialvalue").toInt());
170 QString type =
content_[index].split(
"|").at(0);
171 const QString& value = std::move(content);
172 QString increase =
content_[index].split(
"|").at(2);
173 QString initvalue =
content_[index].split(
"|").at(3);
174 content_[index].replace(
content_[index], type +
"|" + value +
"|" + increase +
"|" + initvalue);
QStringList itemAt(const int) const
NumerotationContext::itemAt.
void clear()
NumerotationContext::clear, clear the content.
void fromXml(QDomElement &)
NumerotationContext::fromXml load numerotation context from .
bool keyIsNumber(const QString &) const
NumerotationContext::keyIsNumber.
QString operator[](const int &) const
NumerotationContext::operator [].
QString validRegExpNum() const
validRegExpNum
QDomElement toXml(QDomDocument &, const QString &)
NumerotationContext::toXml Save the numerotation context in a QDomElement under the element name ...
QString validRegExpNumber() const
NumerotationContext::validRegExpNumber.
void operator<<(const NumerotationContext &)
NumerotationContext::operator << , append other.
int size() const
NumerotationContext::size.
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
void replaceValue(int, QString)
NumerotationContext::replaceValue This class replaces the current NC field value with content...
bool keyIsAcceptable(const QString &) const
NumerotationContext::keyIsAcceptable.
bool isEmpty() const
NumerotationContext::isEmpty.
bool addValue(const QString &, const QVariant &=QVariant(1), const int=1, const int=0)
NumerotationContext::addValue, add a new value on the contexte.