Class: QgsRendererRange¶
Represents a value range for a QgsGraduatedSymbolRenderer
.
Methods
Dumps a string representation of the range. |
|
Returns the label used for the range. |
|
Returns the lower bound of the range. |
|
Returns |
|
Sets the label used for the range. |
|
Sets the lower bound of the range. |
|
Sets whether the range should be rendered. |
|
Sets the symbol used for the range. |
|
Sets the upper bound of the range. |
|
Returns the symbol used for the range. |
|
Creates a DOM element representing the range in SLD format. |
|
Returns the upper bound of the range. |
|
Returns the unique identifier for this range. |
- class qgis.core.QgsRendererRange[source]¶
Bases:
object
- __init__()
- __init__(range: QgsClassificationRange, symbol: QgsSymbol | None, render: bool = True, uuid: str | None = '')
Creates a renderer symbol range
- Parameters:
range (QgsClassificationRange) – The classification range
symbol (Optional[QgsSymbol]) – The symbol for this renderer range
render (bool = True) – If
True
, it will be renderereduuid (Optional[str] = '') – Optional parameter to manually set the UUID key identifier for the this range (since QGIS 3.34).
- __init__(lowerValue: float, upperValue: float, symbol: QgsSymbol | None, label: str | None, render: bool = True, uuid: str | None = '')
Creates a renderer symbol range
- Parameters:
lowerValue (float) – The lower bound of the range
upperValue (float) – The upper bound of the range
symbol (Optional[QgsSymbol]) – The symbol for this renderer range
label (Optional[str]) – The label used for the range
render (bool = True) – If
True
, it will be renderereduuid (Optional[str] = '') – Optional parameter to manually set the UUID key identifier for the this range (since QGIS 3.34).
- __init__(range: QgsRendererRange)
- Parameters:
range (QgsRendererRange)
- lowerValue(self) float [source]¶
Returns the lower bound of the range.
See also
See also
- Return type:
float
- renderState(self) bool [source]¶
Returns
True
if the range should be rendered.See also
- Return type:
bool
- setLabel(self, label: str | None)[source]¶
Sets the label used for the range.
See also
- Parameters:
label (Optional[str])
- setLowerValue(self, lowerValue: float)[source]¶
Sets the lower bound of the range.
See also
See also
- Parameters:
lowerValue (float)
- setRenderState(self, render: bool)[source]¶
Sets whether the range should be rendered.
See also
- Parameters:
render (bool)
- setSymbol(self, s: QgsSymbol | None)[source]¶
Sets the symbol used for the range.
Ownership of the symbol is transferred.
See also
- Parameters:
s (Optional[QgsSymbol])
- setUpperValue(self, upperValue: float)[source]¶
Sets the upper bound of the range.
See also
See also
- Parameters:
upperValue (float)
- symbol(self) QgsSymbol | None [source]¶
Returns the symbol used for the range.
See also
- Return type:
Optional[QgsSymbol]
- toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, Any], firstRange: bool = False)[source]¶
Creates a DOM element representing the range in SLD format.
- Parameters:
doc (QDomDocument) – DOM document
element (QDomElement) – destination DOM element
props (Dict[str, Any]) – graduated renderer properties
firstRange (bool = False) – set to
True
if the range is the first range, where the lower value uses a <= test rather than a < test.
Deprecated since version 3.44: Use the version with
QgsSldExportContext
instead.
- toSld(self, doc: QDomDocument, element: QDomElement, classAttribute: str | None, context: QgsSldExportContext, firstRange: bool = False) bool [source]
Creates a DOM element representing the range in SLD format.
- Parameters:
doc (QDomDocument) – DOM document
element (QDomElement) – destination DOM element
classAttribute (Optional[str]) – classification attribute or expression
context (
QgsSldExportContext
) – conversion contextfirstRange (bool = False) – set to
True
if the range is the first range, where the lower value uses a <= test rather than a < test.
Added in version 3.44.
- Return type:
bool