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

Settings for a color ramp legend node. More...

#include <qgscolorramplegendnodesettings.h>

Public Types

enum  Direction { MinimumToMaximum , MaximumToMinimum }
 Ramp directions. More...

Public Member Functions

 QgsColorRampLegendNodeSettings ()
 QgsColorRampLegendNodeSettings (const QgsColorRampLegendNodeSettings &other)
 QgsColorRampLegendNodeSettings (QgsColorRampLegendNodeSettings &&other)
 ~QgsColorRampLegendNodeSettings ()
QgsColorRampLegendNodeSettings::Direction direction () const
 Returns the direction of the ramp.
QString maximumLabel () const
 Returns the label for the maximum value on the ramp.
QString minimumLabel () const
 Returns the label for the minimum value on the ramp.
const QgsNumericFormatnumericFormat () const
 Returns the numeric format used for numbers in the scalebar.
QgsColorRampLegendNodeSettingsoperator= (const QgsColorRampLegendNodeSettings &other)
QgsColorRampLegendNodeSettingsoperator= (QgsColorRampLegendNodeSettings &&other)
Qt::Orientation orientation () const
 Returns the ramp orientation (i.e.
QString prefix () const
 Returns the prefix to show before legend text.
void readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads settings from an XML element.
void setDirection (QgsColorRampLegendNodeSettings::Direction direction)
 Sets the direction of the ramp.
void setMaximumLabel (const QString &label)
 Sets the label for the maximum value on the ramp.
void setMinimumLabel (const QString &label)
 Sets the label for the minimum value on the ramp.
void setNumericFormat (QgsNumericFormat *format)
 Sets the numeric format used for numbers in the scalebar.
void setOrientation (Qt::Orientation orientation)
 Sets the ramp orientation (i.e.
void setPrefix (const QString &prefix)
 Sets the prefix to show before legend text.
void setSuffix (const QString &suffix)
 Sets the suffix to show after legend text.
void setTextFormat (const QgsTextFormat &format)
 Sets the text format used to render text in the legend item.
void setUseContinuousLegend (bool useContinuousLegend)
 Sets the flag to use a continuous gradient legend to useContinuousLegend.
QString suffix () const
 Returns the suffix to show after legend text.
QgsTextFormat textFormat () const
 Returns the text format used to render text in the legend item.
bool useContinuousLegend () const
 Returns true if a continuous gradient legend will be used.
void writeXml (QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context) const
 Writes settings to an XML element.

Detailed Description

Settings for a color ramp legend node.

Since
QGIS 3.18

Definition at line 38 of file qgscolorramplegendnodesettings.h.

Member Enumeration Documentation

◆ Direction

Ramp directions.

Enumerator
MinimumToMaximum 

Minimum value on bottom, maximum value on top.

MaximumToMinimum 

Maximum value on bottom, minimum value on top.

Definition at line 45 of file qgscolorramplegendnodesettings.h.

Constructor & Destructor Documentation

◆ QgsColorRampLegendNodeSettings() [1/3]

QgsColorRampLegendNodeSettings::QgsColorRampLegendNodeSettings ( )

Definition at line 24 of file qgscolorramplegendnodesettings.cpp.

◆ ~QgsColorRampLegendNodeSettings()

QgsColorRampLegendNodeSettings::~QgsColorRampLegendNodeSettings ( )
default

◆ QgsColorRampLegendNodeSettings() [2/3]

QgsColorRampLegendNodeSettings::QgsColorRampLegendNodeSettings ( const QgsColorRampLegendNodeSettings & other)

Definition at line 29 of file qgscolorramplegendnodesettings.cpp.

◆ QgsColorRampLegendNodeSettings() [3/3]

QgsColorRampLegendNodeSettings::QgsColorRampLegendNodeSettings ( QgsColorRampLegendNodeSettings && other)

Definition at line 45 of file qgscolorramplegendnodesettings.cpp.

Member Function Documentation

◆ direction()

QgsColorRampLegendNodeSettings::Direction QgsColorRampLegendNodeSettings::direction ( ) const

Returns the direction of the ramp.

See also
setDirection()
orientation()

Definition at line 97 of file qgscolorramplegendnodesettings.cpp.

◆ maximumLabel()

QString QgsColorRampLegendNodeSettings::maximumLabel ( ) const

Returns the label for the maximum value on the ramp.

If the returned string is empty than a default value will be generated based on the associated maximum value.

See also
minimumLabel()
setMaximumLabel()

Definition at line 117 of file qgscolorramplegendnodesettings.cpp.

◆ minimumLabel()

QString QgsColorRampLegendNodeSettings::minimumLabel ( ) const

Returns the label for the minimum value on the ramp.

If the returned string is empty than a default value will be generated based on the associated minimum value.

See also
maximumLabel()
setMinimumLabel()

Definition at line 107 of file qgscolorramplegendnodesettings.cpp.

◆ numericFormat()

const QgsNumericFormat * QgsColorRampLegendNodeSettings::numericFormat ( ) const

Returns the numeric format used for numbers in the scalebar.

See also
setNumericFormat()
Since
QGIS 3.12

Definition at line 127 of file qgscolorramplegendnodesettings.cpp.

◆ operator=() [1/2]

QgsColorRampLegendNodeSettings & QgsColorRampLegendNodeSettings::operator= ( const QgsColorRampLegendNodeSettings & other)

Definition at line 59 of file qgscolorramplegendnodesettings.cpp.

◆ operator=() [2/2]

QgsColorRampLegendNodeSettings & QgsColorRampLegendNodeSettings::operator= ( QgsColorRampLegendNodeSettings && other)

Definition at line 78 of file qgscolorramplegendnodesettings.cpp.

◆ orientation()

Qt::Orientation QgsColorRampLegendNodeSettings::orientation ( ) const

Returns the ramp orientation (i.e.

horizontal or vertical).

See also
setOrientation()
direction()

Definition at line 222 of file qgscolorramplegendnodesettings.cpp.

◆ prefix()

QString QgsColorRampLegendNodeSettings::prefix ( ) const

Returns the prefix to show before legend text.

See also
setPrefix()
suffix()

Definition at line 192 of file qgscolorramplegendnodesettings.cpp.

◆ readXml()

void QgsColorRampLegendNodeSettings::readXml ( const QDomElement & element,
const QgsReadWriteContext & context )

Reads settings from an XML element.

Definition at line 161 of file qgscolorramplegendnodesettings.cpp.

◆ setDirection()

void QgsColorRampLegendNodeSettings::setDirection ( QgsColorRampLegendNodeSettings::Direction direction)

Sets the direction of the ramp.

See also
direction()
setOrientation()

Definition at line 102 of file qgscolorramplegendnodesettings.cpp.

◆ setMaximumLabel()

void QgsColorRampLegendNodeSettings::setMaximumLabel ( const QString & label)

Sets the label for the maximum value on the ramp.

If the label is empty than a default value will be generated based on the associated maximum value.

See also
setMinimumLabel()
maximumLabel()

Definition at line 122 of file qgscolorramplegendnodesettings.cpp.

◆ setMinimumLabel()

void QgsColorRampLegendNodeSettings::setMinimumLabel ( const QString & label)

Sets the label for the minimum value on the ramp.

If the label is empty than a default value will be generated based on the associated minimum value.

See also
setMaximumLabel()
minimumLabel()

Definition at line 112 of file qgscolorramplegendnodesettings.cpp.

◆ setNumericFormat()

void QgsColorRampLegendNodeSettings::setNumericFormat ( QgsNumericFormat * format)

Sets the numeric format used for numbers in the scalebar.

Ownership of format is transferred to the scalebar.

See also
numericFormat()
Since
QGIS 3.12

Definition at line 132 of file qgscolorramplegendnodesettings.cpp.

◆ setOrientation()

void QgsColorRampLegendNodeSettings::setOrientation ( Qt::Orientation orientation)

Sets the ramp orientation (i.e.

horizontal or vertical).

See also
orientation()
setDirection()

Definition at line 227 of file qgscolorramplegendnodesettings.cpp.

◆ setPrefix()

void QgsColorRampLegendNodeSettings::setPrefix ( const QString & prefix)

Sets the prefix to show before legend text.

See also
prefix()
setSuffix()

Definition at line 197 of file qgscolorramplegendnodesettings.cpp.

◆ setSuffix()

void QgsColorRampLegendNodeSettings::setSuffix ( const QString & suffix)

Sets the suffix to show after legend text.

See also
suffix()
setPrefix()

Definition at line 207 of file qgscolorramplegendnodesettings.cpp.

◆ setTextFormat()

void QgsColorRampLegendNodeSettings::setTextFormat ( const QgsTextFormat & format)

Sets the text format used to render text in the legend item.

See also
textFormat()

Definition at line 217 of file qgscolorramplegendnodesettings.cpp.

◆ setUseContinuousLegend()

void QgsColorRampLegendNodeSettings::setUseContinuousLegend ( bool useContinuousLegend)

Sets the flag to use a continuous gradient legend to useContinuousLegend.

When this flag is set the legend will be rendered using a continuous color ramp with min and max values, when it is not set the legend will be rendered using separate items for each entry.

See also
setOrientation()
direction()

Definition at line 237 of file qgscolorramplegendnodesettings.cpp.

◆ suffix()

QString QgsColorRampLegendNodeSettings::suffix ( ) const

Returns the suffix to show after legend text.

See also
setSuffix()
prefix()

Definition at line 202 of file qgscolorramplegendnodesettings.cpp.

◆ textFormat()

QgsTextFormat QgsColorRampLegendNodeSettings::textFormat ( ) const

Returns the text format used to render text in the legend item.

See also
setTextFormat()

Definition at line 212 of file qgscolorramplegendnodesettings.cpp.

◆ useContinuousLegend()

bool QgsColorRampLegendNodeSettings::useContinuousLegend ( ) const

Returns true if a continuous gradient legend will be used.

See also
setUseContinuousLegend()

Definition at line 232 of file qgscolorramplegendnodesettings.cpp.

◆ writeXml()

void QgsColorRampLegendNodeSettings::writeXml ( QDomDocument & doc,
QDomElement & element,
const QgsReadWriteContext & context ) const

Writes settings to an XML element.

Definition at line 137 of file qgscolorramplegendnodesettings.cpp.


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