Revert r4900

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4902 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810
2017-02-05 16:18:50 +00:00
parent e233d7ad77
commit 41659fa6fd
98 changed files with 606 additions and 606 deletions

View File

@@ -74,7 +74,7 @@ void ConductorPropertiesDialog::PropertiesDialog(Conductor *conductor, QWidget *
{
undo->setText(tr("Modifier les propriétés de plusieurs conducteurs", "undo caption"));
for (Conductor *potential_conductor: conductor->relatedPotentialConductors())
foreach (Conductor *potential_conductor, conductor->relatedPotentialConductors())
{
old_value.setValue(potential_conductor->properties());
new QPropertyUndoCommand (potential_conductor, "properties", old_value, new_value, undo);

View File

@@ -125,7 +125,7 @@ void DiagramPropertiesEditorDockWidget::selectionChanged()
clear();
}
for (PropertiesEditorWidget *pew: editors())
foreach (PropertiesEditorWidget *pew, editors())
pew->setLiveEdit(true);
}

View File

@@ -157,7 +157,7 @@ bool ElementInfoWidget::event(QEvent *event)
*/
void ElementInfoWidget::enableLiveEdit()
{
for (ElementInfoPartWidget *eipw: m_eipw_list)
foreach (ElementInfoPartWidget *eipw, m_eipw_list)
{
connect(eipw, &ElementInfoPartWidget::textChanged, this, &ElementInfoWidget::apply);
connect(eipw, &ElementInfoPartWidget::showClicked, this, &ElementInfoWidget::apply);
@@ -170,7 +170,7 @@ void ElementInfoWidget::enableLiveEdit()
*/
void ElementInfoWidget::disableLiveEdit()
{
for (ElementInfoPartWidget *eipw: m_eipw_list)
foreach (ElementInfoPartWidget *eipw, m_eipw_list)
{
disconnect(eipw, &ElementInfoPartWidget::textChanged, this, &ElementInfoWidget::apply);
disconnect(eipw, &ElementInfoPartWidget::showClicked, this, &ElementInfoWidget::apply);
@@ -183,7 +183,7 @@ void ElementInfoWidget::disableLiveEdit()
*/
void ElementInfoWidget::buildInterface()
{
for (QString str: QETApp::elementInfoKeys())
foreach (QString str, QETApp::elementInfoKeys())
{
ElementInfoPartWidget *eipw = new ElementInfoPartWidget(str, QETApp::elementTranslatedInfoKey(str), this);
ui->scroll_vlayout->addWidget(eipw);
@@ -199,7 +199,7 @@ void ElementInfoWidget::buildInterface()
*/
ElementInfoPartWidget *ElementInfoWidget::infoPartWidgetForKey(const QString &key) const
{
for (ElementInfoPartWidget *eipw: m_eipw_list)
foreach (ElementInfoPartWidget *eipw, m_eipw_list)
{
if (eipw->key() == key)
return eipw;
@@ -219,7 +219,7 @@ void ElementInfoWidget::updateUi()
if (m_live_edit) disableLiveEdit();
DiagramContext element_info = m_element->elementInformations();
for (ElementInfoPartWidget *eipw: m_eipw_list)
foreach (ElementInfoPartWidget *eipw, m_eipw_list)
{
eipw -> setText (element_info[eipw->key()].toString());
@@ -246,7 +246,7 @@ DiagramContext ElementInfoWidget::currentInfo() const
{
DiagramContext info_;
for (ElementInfoPartWidget *eipw: m_eipw_list)
foreach (ElementInfoPartWidget *eipw, m_eipw_list)
if (!eipw->text().isEmpty()) //add value only if they're something to store
info_.addValue(eipw->key(), eipw->text(), eipw->mustShow());

View File

@@ -61,7 +61,7 @@ void ElementPropertiesWidget::setElement(Element *element)
//If previous element is same type as new element we just call setElement for each editor
if(previous_element->linkType() == m_element->linkType())
{
for (AbstractElementPropertiesEditorWidget *aepew: m_list_editor)
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
{
aepew->setElement(m_element);
addGeneralWidget();
@@ -81,21 +81,21 @@ void ElementPropertiesWidget::apply()
{
QList <QUndoCommand *> undo_list;
for (PropertiesEditorWidget *pew: m_list_editor)
foreach (PropertiesEditorWidget *pew, m_list_editor)
if (QUndoCommand *undo = pew->associatedUndo())
undo_list << undo;
if (undo_list.isEmpty()) return;
QString str;
for (QUndoCommand *uc: undo_list) str += uc->text() += " ";
foreach(QUndoCommand *uc, undo_list) str += uc->text() += " ";
QUndoStack &stack = m_element -> diagram() -> undoStack();
stack.beginMacro(str);
for (QUndoCommand *uc: undo_list) stack.push(uc);
foreach(QUndoCommand *uc, undo_list) stack.push(uc);
stack.endMacro();
for (PropertiesEditorWidget *pew: m_list_editor)
foreach(PropertiesEditorWidget *pew, m_list_editor)
pew->updateUi();
}
@@ -104,7 +104,7 @@ void ElementPropertiesWidget::apply()
* Reset the edited properties
*/
void ElementPropertiesWidget::reset() {
for (PropertiesEditorWidget *pew: m_list_editor) pew->reset();
foreach (PropertiesEditorWidget *pew, m_list_editor) pew->reset();
}
bool ElementPropertiesWidget::setLiveEdit(bool live_edit)
@@ -112,7 +112,7 @@ bool ElementPropertiesWidget::setLiveEdit(bool live_edit)
if (m_live_edit == live_edit) return true;
m_live_edit = live_edit;
for (AbstractElementPropertiesEditorWidget *aepew: m_list_editor)
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
aepew->setLiveEdit(m_live_edit);
return true;
@@ -205,7 +205,7 @@ void ElementPropertiesWidget::updateUi()
}
//Add each editors in tab widget
for (AbstractElementPropertiesEditorWidget *aepew: m_list_editor)
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
{
aepew->setLiveEdit(m_live_edit);
m_tab->addTab(aepew, aepew->title());

View File

@@ -211,7 +211,7 @@ void LinkSingleElementWidget::buildTree()
if (m_element->linkType() == Element::Slave)
{
for (Element *elmt: availableElements())
foreach(Element *elmt, availableElements())
{
QStringList search_list;
QStringList str_list;
@@ -255,7 +255,7 @@ void LinkSingleElementWidget::buildTree()
else if (m_element->linkType() & Element::AllReport)
{
for (Element *elmt: availableElements())
foreach(Element *elmt, availableElements())
{
QStringList search_list;
QStringList str_list;
@@ -362,7 +362,7 @@ void LinkSingleElementWidget::setUpCompleter()
delete ui->m_search_field->completer();
QStringList search;
for (QStringList strl: m_qtwi_strl_hash.values())
foreach(QStringList strl , m_qtwi_strl_hash.values())
search.append(strl);
QCompleter *c = new QCompleter(search, ui->m_search_field);
@@ -385,7 +385,7 @@ void LinkSingleElementWidget::clearTreeWidget()
delete qtwi;
}
for (QTreeWidgetItem *qtwi: m_qtwi_elmt_hash.keys())
foreach(QTreeWidgetItem *qtwi, m_qtwi_elmt_hash.keys())
delete qtwi;
m_qtwi_elmt_hash.clear();
@@ -589,14 +589,14 @@ void LinkSingleElementWidget::on_m_show_this_pb_clicked()
void LinkSingleElementWidget::on_m_search_field_textEdited(const QString &arg1)
{
//Show all items if arg1 is empty, if not hide all items
for (QTreeWidgetItem *qtwi: m_qtwi_elmt_hash.keys())
foreach(QTreeWidgetItem *qtwi, m_qtwi_elmt_hash.keys())
qtwi->setHidden(!arg1.isEmpty());
QList <QTreeWidgetItem *> qtwi_list;
for (QTreeWidgetItem *qtwi: m_qtwi_strl_hash.keys())
foreach(QTreeWidgetItem *qtwi, m_qtwi_strl_hash.keys())
{
for (QString str: m_qtwi_strl_hash.value(qtwi))
foreach(QString str, m_qtwi_strl_hash.value(qtwi))
{
if(str.contains(arg1, Qt::CaseInsensitive))
{
@@ -607,6 +607,6 @@ void LinkSingleElementWidget::on_m_search_field_textEdited(const QString &arg1)
}
//Show items which match with arg1
for (QTreeWidgetItem *qtwi: qtwi_list)
foreach(QTreeWidgetItem *qtwi, qtwi_list)
qtwi->setHidden(false);
}

View File

@@ -150,7 +150,7 @@ void MasterPropertiesWidget::apply() {
*/
void MasterPropertiesWidget::reset()
{
for (QTreeWidgetItem *qtwi: m_qtwi_hash.keys())
foreach (QTreeWidgetItem *qtwi, m_qtwi_hash.keys())
delete qtwi;
m_qtwi_hash.clear();
@@ -177,7 +177,7 @@ QUndoCommand* MasterPropertiesWidget::associatedUndo() const
{
bool equal = true;
for (Element *elmt: to_link)
foreach(Element *elmt, to_link)
if (!linked_.contains(elmt))
equal = false;
@@ -224,7 +224,7 @@ void MasterPropertiesWidget::updateUi()
//Build the list of free available element
QList <QTreeWidgetItem *> items_list;
for (Element *elmt: elmt_prov.freeElement(Element::Slave))
foreach(Element *elmt, elmt_prov.freeElement(Element::Slave))
{
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_free_tree_widget);
qtwi->setIcon(0, elmt->pixmap());
@@ -243,7 +243,7 @@ void MasterPropertiesWidget::updateUi()
items_list.clear();
//Build the list of already linked element
for (Element *elmt: m_element->linkedElements())
foreach(Element *elmt, m_element->linkedElements())
{
QTreeWidgetItem *qtwi = new QTreeWidgetItem(ui->m_link_tree_widget);
qtwi->setIcon(0, elmt->pixmap());

View File

@@ -82,7 +82,7 @@ class NewConductorPotentialSelector : public AbstractPotentialSelector
if ((elmt_->linkType() & Element::Terminale) && !elmt_->terminals().isEmpty())
{
for (Terminal *t: elmt_->terminals())
foreach(Terminal *t, elmt_->terminals())
{
if (t->conductors().isEmpty()) continue;
conductor_in_potential = t->conductors().first();
@@ -106,7 +106,7 @@ class NewConductorPotentialSelector : public AbstractPotentialSelector
c_list = conductor_in_potential->relatedPotentialConductors().toList();
c_list.append(conductor_in_potential);
for (Conductor *c: c_list)
foreach(Conductor *c, c_list)
properties_list.append(c->properties());
}
@@ -139,14 +139,14 @@ class LinkReportPotentialSelector : public AbstractPotentialSelector
m_seq_num_1 = report->conductors().first()->sequenceNum();
m_conductors_list_1.append(report->conductors().first()->relatedPotentialConductors().toList());
m_conductors_list_1.append(report->conductors().first());
for (Conductor *c: m_conductors_list_1)
foreach(Conductor *c, m_conductors_list_1)
m_properties_list_1 << c->properties();
m_conductor_number_2 = other_report->conductors().first()->relatedPotentialConductors().size() + 1;
m_seq_num_2 = other_report->conductors().first()->sequenceNum();
m_conductors_list_2.append(other_report->conductors().first()->relatedPotentialConductors().toList());
m_conductors_list_2.append(other_report->conductors().first());
for (Conductor *c: m_conductors_list_2)
foreach(Conductor *c, m_conductors_list_2)
m_properties_list_2 << c->properties();
//We relink the report
@@ -283,7 +283,7 @@ void PotentialSelectorDialog::on_buttonBox_accepted()
new_seq.setValue(m_sequential_num);
//Set the new properties for each conductors of the new potential
for (Conductor *cond: m_conductors_to_change)
foreach(Conductor *cond, m_conductors_to_change)
{
ConductorProperties new_properties = cond->properties();
new_properties.applyForEqualAttributes(m_properties_list);
@@ -296,7 +296,7 @@ void PotentialSelectorDialog::on_buttonBox_accepted()
//Check if formula of the new potential have incompatible variable with folio report
QRegularExpression rx ("%sequf_|%seqtf_|%seqhf_|%id|%F|%M|%LM");
for (ConductorProperties cp: m_properties_list)
foreach(ConductorProperties cp, m_properties_list)
{
if (cp.m_formula.contains(rx))
{
@@ -316,7 +316,7 @@ void PotentialSelectorDialog::on_buttonBox_accepted()
QString new_formula = fag.formula();
QSet <Conductor *> c_list = m_report->conductors().first()->relatedPotentialConductors();
c_list.insert(m_report->conductors().first());
for (Conductor *cond: c_list)
foreach(Conductor *cond, c_list)
{
old_value.setValue(cond->properties());
ConductorProperties new_properties = cond->properties();
@@ -351,7 +351,7 @@ void PotentialSelectorDialog::on_buttonBox_accepted()
new QPropertyUndoCommand(m_conductor, "properties", old_value, new_value, undo);
//Set the new properties for each conductors of the new potential
for (Conductor *cond: m_conductor->relatedPotentialConductors())
foreach(Conductor *cond, m_conductor->relatedPotentialConductors())
{
new_properties = cond->properties();
new_properties.applyForEqualAttributes(m_properties_list);

View File

@@ -72,7 +72,7 @@ TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(QList<TitleBlockTemplates
{
ui->setupUi(this);
initDialog(current_date,project);
for (TitleBlockTemplatesCollection *c: tbt_collection)
foreach (TitleBlockTemplatesCollection *c, tbt_collection)
addCollection(c);
updateTemplateList();
setProperties(titleblock);
@@ -230,7 +230,7 @@ TitleBlockTemplateLocation TitleBlockPropertiesWidget::currentTitleBlockLocation
{
QET::QetCollection qc = m_map_index_to_collection_type.at(ui->m_tbt_cb->currentIndex());
TitleBlockTemplatesCollection *collection = nullptr;
for (TitleBlockTemplatesCollection *c: m_tbt_collection_list)
foreach (TitleBlockTemplatesCollection *c, m_tbt_collection_list)
if (c -> collection() == qc)
collection = c;
@@ -307,7 +307,7 @@ void TitleBlockPropertiesWidget::initDialog(const bool &current_date, QETProjec
if (project!= NULL){
keys_2 = project -> folioAutoNum().keys();
for (QString str: keys_2) { ui -> auto_page_cb -> addItem(str); }
foreach (QString str, keys_2) { ui -> auto_page_cb -> addItem(str); }
if (ui->auto_page_cb->currentText()==NULL)
ui->auto_page_cb->addItem(tr("Créer un Folio Numérotation Auto"));
}
@@ -365,7 +365,7 @@ void TitleBlockPropertiesWidget::updateTemplateList()
ui -> m_tbt_cb -> addItem(QET::Icons::QETLogo, tr("Modèle par défaut"));
//Add every title block stored in m_tbt_collection_list
for (TitleBlockTemplatesCollection *tbt_c: m_tbt_collection_list)
foreach (TitleBlockTemplatesCollection *tbt_c, m_tbt_collection_list)
{
QIcon icon;
QET::QetCollection qc = tbt_c -> collection();
@@ -376,7 +376,7 @@ void TitleBlockPropertiesWidget::updateTemplateList()
else if (qc == QET::QetCollection::Embedded)
icon = QET::Icons::TitleBlock;
for (QString tbt_name: tbt_c -> templates())
foreach(QString tbt_name, tbt_c -> templates())
{
m_map_index_to_collection_type.append(qc);
ui -> m_tbt_cb -> addItem(icon, tbt_name, tbt_name);
@@ -394,7 +394,7 @@ void TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate(int index)
QET::QetCollection qc = m_map_index_to_collection_type.at(index);
TitleBlockTemplatesCollection *collection = nullptr;
for (TitleBlockTemplatesCollection *c: m_tbt_collection_list)
foreach (TitleBlockTemplatesCollection *c, m_tbt_collection_list)
if (c -> collection() == qc)
collection = c;