Skip to content
Permalink
Browse files

Also use integer/double formating for continous color legend

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10991 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Jul 1, 2009
1 parent 9fda5e4 commit 023c6dbb8ac33f967ec600fd4f84693772b58421
Showing with 21 additions and 2 deletions.
  1. +21 −2 src/app/qgscontinuouscolordialog.cpp
@@ -25,6 +25,7 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
#include "qgslogger.h"
#include <cmath>

#include <QColorDialog>

@@ -136,7 +137,16 @@ void QgsContinuousColorDialog::apply()


//create the render items for minimum and maximum value
QgsSymbol* minsymbol = new QgsSymbol( mVectorLayer->geometryType(), QString::number( minimum, 'f' ), "", "" );
QString minimumString;
if(minimum - floor(minimum) > 0)
{
minimumString = QString::number( minimum, 'f' );
}
else
{
minimumString = QString::number( minimum );
}
QgsSymbol* minsymbol = new QgsSymbol( mVectorLayer->geometryType(), minimumString, "", "" );
QPen minPen;
minPen.setColor( btnMinValue->color() );
minPen.setWidthF( outlinewidthspinbox->value() );
@@ -150,7 +160,16 @@ void QgsContinuousColorDialog::apply()
minsymbol->setPen( minPen );
}

QgsSymbol* maxsymbol = new QgsSymbol( mVectorLayer->geometryType(), QString::number( maximum, 'f' ), "", "" );
QString maximumString;
if(maximum - floor(maximum) > 0)
{
maximumString = QString::number( maximum, 'f' );
}
else
{
maximumString = QString::number( maximum );
}
QgsSymbol* maxsymbol = new QgsSymbol( mVectorLayer->geometryType(), maximumString, "", "" );
QPen maxPen;
maxPen.setColor( btnMaxValue->color() );
maxPen.setWidthF( outlinewidthspinbox->value() );

0 comments on commit 023c6db

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