QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
Public Types | Public Member Functions | List of all members
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)
 Copy constructor. More...
 
 ~QgsColorRampLegendNodeSettings ()
 
QgsColorRampLegendNodeSettings::Direction direction () const
 Returns the direction of the ramp. More...
 
QString maximumLabel () const
 Returns the label for the maximum value on the ramp. More...
 
QString minimumLabel () const
 Returns the label for the minimum value on the ramp. More...
 
const QgsNumericFormatnumericFormat () const
 Returns the numeric format used for numbers in the scalebar. More...
 
QgsColorRampLegendNodeSettingsoperator= (const QgsColorRampLegendNodeSettings &other)
 
Qt::Orientation orientation () const
 Returns the ramp orientation (i.e. More...
 
QString prefix () const
 Returns the prefix to show before legend text. More...
 
void readXml (const QDomElement &element, const QgsReadWriteContext &context)
 Reads settings from an XML element. More...
 
void setDirection (QgsColorRampLegendNodeSettings::Direction direction)
 Sets the direction of the ramp. More...
 
void setMaximumLabel (const QString &label)
 Sets the label for the maximum value on the ramp. More...
 
void setMinimumLabel (const QString &label)
 Sets the label for the minimum value on the ramp. More...
 
void setNumericFormat (QgsNumericFormat *format)
 Sets the numeric format used for numbers in the scalebar. More...
 
void setOrientation (Qt::Orientation orientation)
 Sets the ramp orientation (i.e. More...
 
void setPrefix (const QString &prefix)
 Sets the prefix to show before legend text. More...
 
void setSuffix (const QString &suffix)
 Sets the suffix to show after legend text. More...
 
void setTextFormat (const QgsTextFormat &format)
 Sets the text format used to render text in the legend item. More...
 
void setUseContinuousLegend (bool useContinuousLegend)
 Sets the flag to use a continuos gradient legend to useContinuousLegend. More...
 
QString suffix () const
 Returns the suffix to show after legend text. More...
 
QgsTextFormat textFormat () const
 Returns the text format used to render text in the legend item. More...
 
bool useContinuousLegend () const
 Returns true if a continuous gradient legend will be used. More...
 
void writeXml (QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context) const
 Writes settings to an XML element. More...
 

Detailed Description

Settings for a color ramp legend node.

Since
QGIS 3.18

Definition at line 37 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 44 of file qgscolorramplegendnodesettings.h.

Constructor & Destructor Documentation

◆ QgsColorRampLegendNodeSettings() [1/2]

QgsColorRampLegendNodeSettings::QgsColorRampLegendNodeSettings ( )

Definition at line 23 of file qgscolorramplegendnodesettings.cpp.

◆ ~QgsColorRampLegendNodeSettings()

QgsColorRampLegendNodeSettings::~QgsColorRampLegendNodeSettings ( )
default

◆ QgsColorRampLegendNodeSettings() [2/2]

QgsColorRampLegendNodeSettings::QgsColorRampLegendNodeSettings ( const QgsColorRampLegendNodeSettings other)

Copy constructor.

Definition at line 28 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 58 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 78 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 68 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 88 of file qgscolorramplegendnodesettings.cpp.

◆ operator=()

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

Definition at line 42 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 183 of file qgscolorramplegendnodesettings.cpp.

◆ prefix()

QString QgsColorRampLegendNodeSettings::prefix ( ) const

Returns the prefix to show before legend text.

See also
setPrefix()
suffix()

Definition at line 153 of file qgscolorramplegendnodesettings.cpp.

◆ readXml()

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

Reads settings from an XML element.

Definition at line 122 of file qgscolorramplegendnodesettings.cpp.

◆ setDirection()

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

Sets the direction of the ramp.

See also
direction()
setOrientation()

Definition at line 63 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 83 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 73 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 93 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 188 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 158 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 168 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 178 of file qgscolorramplegendnodesettings.cpp.

◆ setUseContinuousLegend()

void QgsColorRampLegendNodeSettings::setUseContinuousLegend ( bool  useContinuousLegend)

Sets the flag to use a continuos 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 198 of file qgscolorramplegendnodesettings.cpp.

◆ suffix()

QString QgsColorRampLegendNodeSettings::suffix ( ) const

Returns the suffix to show after legend text.

See also
setSuffix()
prefix()

Definition at line 163 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 173 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 193 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 98 of file qgscolorramplegendnodesettings.cpp.


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