Skip to content
Permalink
Browse files

Some const-correctness for rules

  • Loading branch information
m-kuhn committed Apr 18, 2018
1 parent 7123803 commit 7e9aeda7391df1d50192c834332c966bac587c50
@@ -351,7 +351,7 @@ Create a rule from an XML definition
:return: A new rule
%End

QgsRuleBasedRenderer::RuleList &children();
const QgsRuleBasedRenderer::RuleList &children();
%Docstring
Return all children rules of this rule

@@ -374,7 +374,7 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer
*
* \returns A list of rules
*/
QgsRuleBasedRenderer::RuleList &children() { return mChildren; }
const QgsRuleBasedRenderer::RuleList &children() { return mChildren; }

/**
* Returns all children, grand-children, grand-grand-children, grand-gra... you get it
@@ -342,10 +342,10 @@ QList<QgsSymbol *> QgsRuleBasedRendererWidget::selectedSymbols()
{
QModelIndex parent = range.parent();
QgsRuleBasedRenderer::Rule *parentRule = mModel->ruleForIndex( parent );
QgsRuleBasedRenderer::RuleList &children = parentRule->children();
const QgsRuleBasedRenderer::RuleList &children = parentRule->children();
for ( int row = range.top(); row <= range.bottom(); row++ )
{
symbolList.append( children[row]->symbol() );
symbolList.append( children.at( row )->symbol() );
}
}

@@ -360,10 +360,10 @@ QgsRuleBasedRenderer::RuleList QgsRuleBasedRendererWidget::selectedRules()
{
QModelIndex parent = range.parent();
QgsRuleBasedRenderer::Rule *parentRule = mModel->ruleForIndex( parent );
QgsRuleBasedRenderer::RuleList &children = parentRule->children();
const QgsRuleBasedRenderer::RuleList &children = parentRule->children();
for ( int row = range.top(); row <= range.bottom(); row++ )
{
rl.append( children[row]->clone() );
rl.append( children.at( row )->clone() );
}
}
return rl;

0 comments on commit 7e9aeda

Please sign in to comment.
You can’t perform that action at this time.