Skip to content
Permalink
Browse files
Rule-based renderer: show 1:inf instead of 1:0 when there is no max. …
…scale denominator

git-svn-id: http://svn.osgeo.org/qgis/trunk@13713 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jun 12, 2010
1 parent 90ff519 commit 1d26b3303e4728651eedd4b524b1f9aa481e3d29
@@ -387,6 +387,15 @@ void QgsRendererRulesTreeWidget::setGrouping( Grouping g )
populateRules();
}

QString QgsRendererRulesTreeWidget::formatScaleRange( int minDenom, int maxDenom )
{
if ( maxDenom != 0 )
return QString( "<1:%1, 1:%2>" ).arg( minDenom ).arg( maxDenom );
else
return QString( "<1:%1, 1:inf>" ).arg( minDenom );
}


void QgsRendererRulesTreeWidget::populateRules()
{
if ( !mR ) return;
@@ -412,7 +421,7 @@ void QgsRendererRulesTreeWidget::populateRulesNoGrouping()
if ( txt.isEmpty() ) txt = tr( "(no filter)" );
if ( rule.dependsOnScale() )
{
txt += QString( ", scale <1:%1, 1:%2>" ).arg( rule.scaleMinDenom() ).arg( rule.scaleMaxDenom() );
txt += QString( ", scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
}

item->setText( 0, txt );
@@ -438,7 +447,7 @@ void QgsRendererRulesTreeWidget::populateRulesGroupByScale()
{
QString txt;
if ( rule.dependsOnScale() )
txt = QString( "scale <1:%1, 1:%2>" ).arg( rule.scaleMinDenom() ).arg( rule.scaleMaxDenom() );
txt = QString( "scale " ) + formatScaleRange( rule.scaleMinDenom(), rule.scaleMaxDenom() );
else
txt = "any scale";

@@ -43,6 +43,8 @@ class QgsRendererRulesTreeWidget : public QTreeWidget
void populateRulesGroupByScale();
void populateRulesGroupByFilter();

QString formatScaleRange( int minDenom, int maxDenom );

QgsRuleBasedRendererV2* mR;
Grouping mGrouping;
};

0 comments on commit 1d26b33

Please sign in to comment.