Skip to content

Commit

Permalink
De-Q_FOREACH-ification
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jan 18, 2019
1 parent 9875821 commit a01caa4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/3d/qgsrulebased3drenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void QgsRuleBased3DRenderer::Rule::initFilter()
void QgsRuleBased3DRenderer::Rule::updateElseRules()
{
mElseRules.clear();
Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
{
if ( rule->isElse() )
mElseRules << rule;
Expand Down Expand Up @@ -142,7 +142,7 @@ const QgsRuleBased3DRenderer::Rule *QgsRuleBased3DRenderer::Rule::findRuleByKey(
if ( key == mRuleKey )
return this;

Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
{
const Rule *r = rule->findRuleByKey( key );
if ( r )
Expand Down Expand Up @@ -171,7 +171,7 @@ QgsRuleBased3DRenderer::Rule *QgsRuleBased3DRenderer::Rule::clone() const
Rule *newrule = new Rule( symbol, mFilterExp, mDescription );
newrule->setActive( mIsActive );
// clone children
Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
newrule->appendChild( rule->clone() );
return newrule;
}
Expand Down Expand Up @@ -277,7 +277,7 @@ void QgsRuleBased3DRenderer::Rule::createHandlers( QgsVectorLayer *layer, QgsRul
}

// call recursively
Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
{
rule->createHandlers( layer, handlers );
}
Expand All @@ -303,7 +303,7 @@ void QgsRuleBased3DRenderer::Rule::prepare( const Qgs3DRenderContext &context, Q
}

// call recursively
Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
{
rule->prepare( context, attributeNames, handlers );
}
Expand All @@ -326,7 +326,7 @@ QgsRuleBased3DRenderer::Rule::RegisterResult QgsRuleBased3DRenderer::Rule::regis
bool willRegisterSomething = false;

// call recursively
Q_FOREACH ( Rule *rule, mChildren )
for ( Rule *rule : qgis::as_const( mChildren ) )
{
// Don't process else rules yet
if ( !rule->isElse() )
Expand All @@ -341,7 +341,7 @@ QgsRuleBased3DRenderer::Rule::RegisterResult QgsRuleBased3DRenderer::Rule::regis
// If none of the rules passed then we jump into the else rules and process them.
if ( !willRegisterSomething )
{
Q_FOREACH ( Rule *rule, mElseRules )
for ( Rule *rule : qgis::as_const( mElseRules ) )
{
registered |= rule->registerFeature( feature, context, handlers ) != Filtered;
}
Expand Down Expand Up @@ -440,7 +440,7 @@ Qt3DCore::QEntity *QgsRuleBased3DRenderer::createEntity( const Qgs3DMapSettings
}

Qt3DCore::QEntity *entity = new Qt3DCore::QEntity;
Q_FOREACH ( QgsFeature3DHandler *handler, handlers.values() )
for ( QgsFeature3DHandler *handler : handlers.values() )
handler->finalize( entity, context );

qDeleteAll( handlers.values() );
Expand Down

0 comments on commit a01caa4

Please sign in to comment.