Skip to content

Commit

Permalink
Range-based for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 28, 2017
1 parent 67d2dd5 commit 8bef8d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/app/qgsattributesformproperties.cpp
Expand Up @@ -185,7 +185,7 @@ QgsAttributesFormProperties::FieldConfig QgsAttributesFormProperties::configForC
}


QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *mTree )
QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *tree )
{
QTreeWidgetItem *newWidget = nullptr;
switch ( widgetDef->type() )
Expand All @@ -194,7 +194,7 @@ QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAt
{
DnDTreeItemData itemData = DnDTreeItemData( DnDTreeItemData::Field, widgetDef->name() );
itemData.setShowLabel( widgetDef->showLabel() );
newWidget = mTree->addItem( parent, itemData );
newWidget = tree->addItem( parent, itemData );
break;
}

Expand All @@ -208,7 +208,7 @@ QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAt
relEdConfig.showUnlinkButton = relationEditor->showUnlinkButton();
itemData.setRelationEditorConfiguration( relEdConfig );

newWidget = mTree->addItem( parent, itemData );
newWidget = tree->addItem( parent, itemData );
break;
}

Expand All @@ -224,11 +224,12 @@ QTreeWidgetItem *QgsAttributesFormProperties::loadAttributeEditorTreeItem( QgsAt
itemData.setColumnCount( container->columnCount() );
itemData.setShowAsGroupBox( container->isGroupBox() );
itemData.setVisibilityExpression( container->visibilityExpression() );
newWidget = mTree->addItem( parent, itemData );
newWidget = tree->addItem( parent, itemData );

Q_FOREACH ( QgsAttributeEditorElement *wdg, container->children() )
const QList<QgsAttributeEditorElement *> children = container->children();
for ( QgsAttributeEditorElement *wdg : children )
{
loadAttributeEditorTreeItem( wdg, newWidget, mTree );
loadAttributeEditorTreeItem( wdg, newWidget, tree );
}
}
break;
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsattributesformproperties.h
Expand Up @@ -163,8 +163,8 @@ class APP_EXPORT QgsAttributesFormProperties : public QWidget, private Ui_QgsAtt

void loadRelations();

void loadAttributeEditorTree(DnDTree *tree );
QTreeWidgetItem *loadAttributeEditorTreeItem(QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *tree );
void loadAttributeEditorTree( DnDTree *tree );
QTreeWidgetItem *loadAttributeEditorTreeItem( QgsAttributeEditorElement *const widgetDef, QTreeWidgetItem *parent, DnDTree *tree );

protected:
void updateButtons();
Expand Down

0 comments on commit 8bef8d8

Please sign in to comment.