20 #include "ui_numparteditorw.h" 28 intValidator (new QIntValidator(0,99999,this)),
43 intValidator (new QIntValidator(0,99999,this)),
51 QStringList strl = context.
itemAt(i);
66 ui -> value_field -> setText(strl.at(1));
67 ui -> increase_spinBox -> setValue(strl.at(2).toInt());
82 ui->type_cb->setInsertPolicy(QComboBox::InsertAtBottom);
86 items <<
tr(
"Chiffre 1") <<
tr(
"Chiffre 01")
92 items <<
tr(
"Chiffre 1") <<
tr(
"Chiffre 1 - Folio") <<
tr(
"Chiffre 01")
93 <<
tr(
"Chiffre 01 - Folio") <<
tr(
"Chiffre 001") <<
tr(
"Chiffre 001 - Folio")
94 <<
tr(
"Texte") <<
tr(
"N° folio") <<
tr(
"Folio") <<
tr(
"Installation") <<
tr(
"Locmach");
97 items <<
tr(
"Chiffre 1") <<
tr(
"Chiffre 1 - Folio") <<
tr(
"Chiffre 01")
98 <<
tr(
"Chiffre 01 - Folio") <<
tr(
"Chiffre 001") <<
tr(
"Chiffre 001 - Folio")
99 <<
tr(
"Texte") <<
tr(
"N° folio") <<
tr(
"Folio") <<
tr(
"Installation") <<
tr(
"Locmach")
100 <<
tr(
"Element Line") <<
tr(
"Element Column") <<
tr(
"Element Prefix");
101 ui->type_cb->insertItems(0,items);
116 type_str =
"unitfolio";
122 type_str =
"tenfolio";
125 type_str =
"hundred";
128 type_str =
"hundredfolio";
134 type_str =
"idfolio";
143 type_str =
"locmach";
146 type_str =
"elementline";
149 type_str =
"elementcolumn";
152 type_str =
"elementprefix";
155 if (type_str ==
"unitfolio" || type_str ==
"tenfolio" || type_str ==
"hundredfolio")
156 nc.
addValue(type_str,
ui -> value_field -> displayText(),
ui -> increase_spinBox -> value(),
ui->value_field->displayText().toInt());
158 nc.
addValue(type_str,
ui -> value_field -> displayText(),
ui -> increase_spinBox -> value());
169 else if(
ui -> value_field -> text().isEmpty()) {
return false;}
178 if (
ui->type_cb->currentText() ==
tr(
"Chiffre 1"))
180 else if (
ui->type_cb->currentText() ==
tr(
"Chiffre 1 - Folio"))
182 else if (
ui->type_cb->currentText() ==
tr(
"Chiffre 01"))
184 else if (
ui->type_cb->currentText() ==
tr(
"Chiffre 01 - Folio"))
186 else if (
ui->type_cb->currentText() ==
tr(
"Chiffre 001"))
188 else if (
ui->type_cb->currentText() ==
tr(
"Chiffre 001 - Folio"))
190 else if (
ui->type_cb->currentText() ==
tr(
"Texte"))
192 else if (
ui->type_cb->currentText() ==
tr(
"N° folio"))
194 else if (
ui->type_cb->currentText() ==
tr(
"Folio"))
196 else if (
ui->type_cb->currentText() ==
tr(
"Installation"))
198 else if (
ui->type_cb->currentText() ==
tr(
"Locmach"))
200 else if (
ui->type_cb->currentText() ==
tr(
"Element Line"))
202 else if (
ui->type_cb->currentText() ==
tr(
"Element Column"))
204 else if (
ui->type_cb->currentText() ==
tr(
"Element Prefix"))
222 if (!
ui -> value_field -> text().isEmpty()) emit
changed();
240 ui -> value_field -> clear();
241 ui -> value_field -> setEnabled(
true);
243 ui -> increase_spinBox -> setEnabled(
true);
244 ui -> increase_spinBox -> setValue(1);
249 ui -> value_field -> clear();
250 ui -> increase_spinBox -> setDisabled(
true);
252 ui -> value_field -> setValidator(
nullptr);
253 ui -> value_field -> setEnabled(
true);
256 ui -> value_field -> setDisabled(
true);
257 ui -> increase_spinBox -> setDisabled(
true);
260 ui -> value_field -> setDisabled(
true);
261 ui -> increase_spinBox -> setDisabled(
true);
264 ui -> value_field -> setDisabled(
true);
265 ui -> increase_spinBox -> setDisabled(
true);
268 ui -> value_field -> setDisabled(
true);
269 ui -> increase_spinBox -> setDisabled(
true);
272 ui -> value_field -> setDisabled(
true);
273 ui -> increase_spinBox -> setDisabled(
true);
276 ui -> value_field -> setDisabled(
true);
277 ui -> increase_spinBox -> setDisabled(
true);
280 ui -> value_field -> setDisabled(
true);
281 ui -> increase_spinBox -> setDisabled(
true);
295 i =
ui->type_cb->findText(
tr(
"Chiffre 1"));
297 i =
ui->type_cb->findText(
tr(
"Chiffre 1 - Folio"));
299 i =
ui->type_cb->findText(
tr(
"Chiffre 01"));
301 i =
ui->type_cb->findText(
tr(
"Chiffre 01 - Folio"));
303 i =
ui->type_cb->findText(
tr(
"Chiffre 001"));
305 i =
ui->type_cb->findText(
tr(
"Chiffre 001 - Folio"));
306 else if (t ==
string)
307 i =
ui->type_cb->findText(
tr(
"Texte"));
309 i =
ui->type_cb->findText(
tr(
"N° folio"));
311 i =
ui->type_cb->findText(
tr(
"Folio"));
313 i =
ui->type_cb->findText(
tr(
"Installation"));
315 i =
ui->type_cb->findText(
tr(
"Locmach"));
317 i =
ui->type_cb->findText(
tr(
"Element Line"));
319 i =
ui->type_cb->findText(
tr(
"Element Column"));
321 i =
ui->type_cb->findText(
tr(
"Element Prefix"));
322 ui->type_cb->setCurrentIndex(i);
~NumPartEditorW() override
NumPartEditorW(int type, QWidget *parent=nullptr)
QStringList itemAt(const int) const
NumerotationContext::itemAt.
QValidator * intValidator
void on_type_cb_activated(int)
NumPartEditorW::on_type_cb_activated Action when user change the type comboBox.
bool isValid()
NumPartEditorW::isValid.
int size() const
NumerotationContext::size.
NumerotationContext toNumContext()
NumPartEditorW::toNumContext.
void setType(NumPartEditorW::type t, bool=false)
NumPartEditorW::setType Set good behavior by type .
void on_increase_spinBox_valueChanged(int)
NumPartEditorW::on_increase_spinBox_valueChanged emit changed when value changed.
bool addValue(const QString &, const QVariant &=QVariant(1), const int=1, const int=0)
NumerotationContext::addValue, add a new value on the contexte.
void setCurrentIndex(NumPartEditorW::type)
NumPartEditorW::setCurrentIndex Set Current Index of type_cb.
void on_value_field_textEdited()
NumPartEditorW::on_value_field_textChanged emit changed when text changed.