Skip to content

Commit

Permalink
Rule-based renderer: dump meaningful debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jul 19, 2011
1 parent 8e08c53 commit 7d74fe0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void QgsRuleBasedRendererV2::Rule::initFilter()

QString QgsRuleBasedRendererV2::Rule::dump() const
{
return QString( "RULE %1 - scale [%2,%3] - filter %4 - symbol %5" )
return QString( "RULE %1 - scale [%2,%3] - filter %4 - symbol %5\n" )
.arg( mLabel ).arg( mScaleMinDenom ).arg( mScaleMaxDenom )
.arg( mFilterExp ).arg( mSymbol->dump() );

Expand Down Expand Up @@ -409,3 +409,13 @@ QList<QgsRuleBasedRendererV2::Rule> QgsRuleBasedRendererV2::refineRuleScales( Qg
rules.append( Rule( initialRule.symbol()->clone(), oldScale, maxDenom, initialRule.filterExpression(), initialRule.label(), initialRule.description() ) );
return rules;
}

QString QgsRuleBasedRendererV2::dump()
{
QString msg( "Rule-based renderer:\n" );
foreach( const Rule& rule, mRules )
{
msg += rule.dump();
}
return msg;
}
3 changes: 3 additions & 0 deletions src/core/symbology-ng/qgsrulebasedrendererv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class CORE_EXPORT QgsRuleBasedRendererV2 : public QgsFeatureRendererV2
//! @note: this method was added in version 1.5
virtual QgsLegendSymbolList legendSymbolItems();

//! for debugging
virtual QString dump();

/////

//! return the total number of rules
Expand Down

0 comments on commit 7d74fe0

Please sign in to comment.