QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
QgsRendererRange Class Reference

Represents a value range for a QgsGraduatedSymbolRenderer. More...

#include <qgsrendererrange.h>

Public Member Functions

 QgsRendererRange ()=default
 QgsRendererRange (const QgsClassificationRange &range, QgsSymbol *symbol, bool render=true, const QString &uuid=QString())
 Creates a renderer symbol range.
 QgsRendererRange (const QgsRendererRange &range)
 QgsRendererRange (double lowerValue, double upperValue, QgsSymbol *symbol, const QString &label, bool render=true, const QString &uuid=QString())
 Creates a renderer symbol range.
 ~QgsRendererRange ()
QString dump () const
 Dumps a string representation of the range.
QString label () const
 Returns the label used for the range.
double lowerValue () const
 Returns the lower bound of the range.
bool operator< (const QgsRendererRange &other) const
QgsRendererRangeoperator= (QgsRendererRange range)
bool renderState () const
 Returns true if the range should be rendered.
void setLabel (const QString &label)
 Sets the label used for the range.
void setLowerValue (double lowerValue)
 Sets the lower bound of the range.
void setRenderState (bool render)
 Sets whether the range should be rendered.
void setSymbol (QgsSymbol *s)
 Sets the symbol used for the range.
void setUpperValue (double upperValue)
 Sets the upper bound of the range.
QgsSymbolsymbol () const
 Returns the symbol used for the range.
bool toSld (QDomDocument &doc, QDomElement &element, const QString &classAttribute, QgsSldExportContext &context, bool firstRange=false) const
 Creates a DOM element representing the range in SLD format.
Q_DECL_DEPRECATED void toSld (QDomDocument &doc, QDomElement &element, QVariantMap props, bool firstRange=false) const
 Creates a DOM element representing the range in SLD format.
double upperValue () const
 Returns the upper bound of the range.
QString uuid () const
 Returns the unique identifier for this range.

Protected Attributes

QString mLabel
double mLowerValue = 0
bool mRender = true
std::unique_ptr< QgsSymbolmSymbol
double mUpperValue = 0
QString mUuid

Friends

class QgsGraduatedSymbolRendererWidget

Detailed Description

Represents a value range for a QgsGraduatedSymbolRenderer.

Definition at line 37 of file qgsrendererrange.h.

Constructor & Destructor Documentation

◆ QgsRendererRange() [1/4]

QgsRendererRange::QgsRendererRange ( )
default

◆ ~QgsRendererRange()

QgsRendererRange::~QgsRendererRange ( )
default

◆ QgsRendererRange() [2/4]

QgsRendererRange::QgsRendererRange ( const QgsClassificationRange & range,
QgsSymbol * symbol,
bool render = true,
const QString & uuid = QString() )

Creates a renderer symbol range.

Parameters
rangeThe classification range
symbolThe symbol for this renderer range
renderIf true, it will be renderered
uuidOptional parameter to manually set the UUID key identifier for the this range (since QGIS 3.34).

Definition at line 25 of file qgsrendererrange.cpp.

◆ QgsRendererRange() [3/4]

QgsRendererRange::QgsRendererRange ( double lowerValue,
double upperValue,
QgsSymbol * symbol,
const QString & label,
bool render = true,
const QString & uuid = QString() )

Creates a renderer symbol range.

Parameters
lowerValueThe lower bound of the range
upperValueThe upper bound of the range
symbolThe symbol for this renderer range
labelThe label used for the range
renderIf true, it will be renderered
uuidOptional parameter to manually set the UUID key identifier for the this range (since QGIS 3.34).

Definition at line 35 of file qgsrendererrange.cpp.

◆ QgsRendererRange() [4/4]

QgsRendererRange::QgsRendererRange ( const QgsRendererRange & range)

Definition at line 45 of file qgsrendererrange.cpp.

Member Function Documentation

◆ dump()

QString QgsRendererRange::dump ( ) const

Dumps a string representation of the range.

Definition at line 132 of file qgsrendererrange.cpp.

◆ label()

QString QgsRendererRange::label ( ) const

Returns the label used for the range.

See also
setLabel()

Definition at line 97 of file qgsrendererrange.cpp.

◆ lowerValue()

double QgsRendererRange::lowerValue ( ) const

Returns the lower bound of the range.

See also
setLowerValue()
upperValue()

Definition at line 82 of file qgsrendererrange.cpp.

◆ operator<()

bool QgsRendererRange::operator< ( const QgsRendererRange & other) const

Definition at line 70 of file qgsrendererrange.cpp.

◆ operator=()

QgsRendererRange & QgsRendererRange::operator= ( QgsRendererRange range)

Definition at line 56 of file qgsrendererrange.cpp.

◆ renderState()

bool QgsRendererRange::renderState ( ) const

Returns true if the range should be rendered.

See also
setRenderState()

Definition at line 122 of file qgsrendererrange.cpp.

◆ setLabel()

void QgsRendererRange::setLabel ( const QString & label)

Sets the label used for the range.

See also
label()

Definition at line 107 of file qgsrendererrange.cpp.

◆ setLowerValue()

void QgsRendererRange::setLowerValue ( double lowerValue)

Sets the lower bound of the range.

See also
lowerValue()
setUpperValue()

Definition at line 117 of file qgsrendererrange.cpp.

◆ setRenderState()

void QgsRendererRange::setRenderState ( bool render)

Sets whether the range should be rendered.

See also
renderState()

Definition at line 127 of file qgsrendererrange.cpp.

◆ setSymbol()

void QgsRendererRange::setSymbol ( QgsSymbol * s)

Sets the symbol used for the range.

Ownership of the symbol is transferred.

See also
symbol()

Definition at line 102 of file qgsrendererrange.cpp.

◆ setUpperValue()

void QgsRendererRange::setUpperValue ( double upperValue)

Sets the upper bound of the range.

See also
upperValue()
setLowerValue()

Definition at line 112 of file qgsrendererrange.cpp.

◆ symbol()

QgsSymbol * QgsRendererRange::symbol ( ) const

Returns the symbol used for the range.

See also
setSymbol()

Definition at line 92 of file qgsrendererrange.cpp.

◆ toSld() [1/2]

bool QgsRendererRange::toSld ( QDomDocument & doc,
QDomElement & element,
const QString & classAttribute,
QgsSldExportContext & context,
bool firstRange = false ) const

Creates a DOM element representing the range in SLD format.

Parameters
docDOM document
elementdestination DOM element
classAttributeclassification attribute or expression
contextconversion context
firstRangeset to true if the range is the first range, where the lower value uses a <= test rather than a < test.
Since
QGIS 3.44

Definition at line 144 of file qgsrendererrange.cpp.

◆ toSld() [2/2]

void QgsRendererRange::toSld ( QDomDocument & doc,
QDomElement & element,
QVariantMap props,
bool firstRange = false ) const

Creates a DOM element representing the range in SLD format.

Parameters
docDOM document
elementdestination DOM element
propsgraduated renderer properties
firstRangeset to true if the range is the first range, where the lower value uses a <= test rather than a < test.
Deprecated
QGIS 3.44. Use the version with QgsSldExportContext instead.

Definition at line 137 of file qgsrendererrange.cpp.

◆ upperValue()

double QgsRendererRange::upperValue ( ) const

Returns the upper bound of the range.

See also
setUpperValue()
lowerValue()

Definition at line 87 of file qgsrendererrange.cpp.

◆ uuid()

QString QgsRendererRange::uuid ( ) const

Returns the unique identifier for this range.

Since
QGIS 3.34

Definition at line 77 of file qgsrendererrange.cpp.

◆ QgsGraduatedSymbolRendererWidget

friend class QgsGraduatedSymbolRendererWidget
friend

Definition at line 208 of file qgsrendererrange.h.

Member Data Documentation

◆ mLabel

QString QgsRendererRange::mLabel
protected

Definition at line 212 of file qgsrendererrange.h.

◆ mLowerValue

double QgsRendererRange::mLowerValue = 0
protected

Definition at line 210 of file qgsrendererrange.h.

◆ mRender

bool QgsRendererRange::mRender = true
protected

Definition at line 213 of file qgsrendererrange.h.

◆ mSymbol

std::unique_ptr<QgsSymbol> QgsRendererRange::mSymbol
protected

Definition at line 211 of file qgsrendererrange.h.

◆ mUpperValue

double QgsRendererRange::mUpperValue = 0
protected

Definition at line 210 of file qgsrendererrange.h.

◆ mUuid

QString QgsRendererRange::mUuid
protected

Definition at line 214 of file qgsrendererrange.h.


The documentation for this class was generated from the following files: