Skip to content

Commit 603a3dd

Browse files
author
wonder
committed
Added convenience constructor for color ramp shader
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14023 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 38e5d59 commit 603a3dd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

python/core/qgsrastershaderfunction.sip

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ class QgsColorRampShader : QgsRasterShaderFunction
5252
//not a color but a quantity, e.g. temperature or elevation
5353
struct ColorRampItem
5454
{
55+
//! default constructor
56+
ColorRampItem();
57+
//! convenience constructor - added in v1.6
58+
ColorRampItem( double val, QColor col, QString lbl = QString() );
59+
5560
QString label;
5661
double value;
5762
QColor color;

src/core/raster/qgscolorrampshader.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class CORE_EXPORT QgsColorRampShader : public QgsRasterShaderFunction
4141
//not a color but a quantity, e.g. temperature or elevation
4242
struct ColorRampItem
4343
{
44+
//! default constructor
45+
ColorRampItem() {}
46+
//! convenience constructor - added in v1.6
47+
ColorRampItem( double val, QColor col, QString lbl = QString() ) : label(lbl), value(val), color(col) {}
48+
4449
QString label;
4550
double value;
4651
QColor color;

0 commit comments

Comments
 (0)