mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 23:20:52 +01:00
Replace foreach function by for, please try and report problem
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4900 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -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())
|
||||
{
|
||||
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
|
||||
for (AbstractElementPropertiesEditorWidget *aepew: m_list_editor)
|
||||
{
|
||||
aepew->setElement(m_element);
|
||||
addGeneralWidget();
|
||||
@@ -81,21 +81,21 @@ void ElementPropertiesWidget::apply()
|
||||
{
|
||||
QList <QUndoCommand *> undo_list;
|
||||
|
||||
foreach (PropertiesEditorWidget *pew, m_list_editor)
|
||||
for (PropertiesEditorWidget *pew: m_list_editor)
|
||||
if (QUndoCommand *undo = pew->associatedUndo())
|
||||
undo_list << undo;
|
||||
|
||||
if (undo_list.isEmpty()) return;
|
||||
|
||||
QString str;
|
||||
foreach(QUndoCommand *uc, undo_list) str += uc->text() += " ";
|
||||
for (QUndoCommand *uc: undo_list) str += uc->text() += " ";
|
||||
|
||||
QUndoStack &stack = m_element -> diagram() -> undoStack();
|
||||
stack.beginMacro(str);
|
||||
foreach(QUndoCommand *uc, undo_list) stack.push(uc);
|
||||
for (QUndoCommand *uc: undo_list) stack.push(uc);
|
||||
stack.endMacro();
|
||||
|
||||
foreach(PropertiesEditorWidget *pew, m_list_editor)
|
||||
for (PropertiesEditorWidget *pew: m_list_editor)
|
||||
pew->updateUi();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ void ElementPropertiesWidget::apply()
|
||||
* Reset the edited properties
|
||||
*/
|
||||
void ElementPropertiesWidget::reset() {
|
||||
foreach (PropertiesEditorWidget *pew, m_list_editor) pew->reset();
|
||||
for (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;
|
||||
|
||||
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
|
||||
for (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
|
||||
foreach (AbstractElementPropertiesEditorWidget *aepew, m_list_editor)
|
||||
for (AbstractElementPropertiesEditorWidget *aepew: m_list_editor)
|
||||
{
|
||||
aepew->setLiveEdit(m_live_edit);
|
||||
m_tab->addTab(aepew, aepew->title());
|
||||
|
||||
Reference in New Issue
Block a user