QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Signals | Public Member Functions | List of all members
QgsConditionalLayerStyles Class Reference

The QgsConditionalLayerStyles class holds conditional style information for a layer. More...

#include <qgsconditionalstyle.h>

Inheritance diagram for QgsConditionalLayerStyles:
Inheritance graph
[legend]

Signals

void changed ()
 Emitted when the conditional styles are changed. More...
 

Public Member Functions

 QgsConditionalLayerStyles (QObject *parent=nullptr)
 Constructor for QgsConditionalLayerStyles, with the specified parent object. More...
 
QgsConditionalStyle constraintFailureStyles (QgsFieldConstraints::ConstraintStrength strength)
 Returns a style associated to a constraint failure. More...
 
QList< QgsConditionalStylefieldStyles (const QString &fieldName) const
 Returns the conditional styles set for the field with matching fieldName. More...
 
bool readXml (const QDomNode &node, const QgsReadWriteContext &context)
 Reads the condition styles state from a DOM node. More...
 
QgsConditionalStyles rowStyles () const
 Returns a list of row styles associated with the layer. More...
 
bool rulesNeedGeometry () const
 Returns true if at least one rule needs geometry. More...
 
void setFieldStyles (const QString &fieldName, const QList< QgsConditionalStyle > &styles)
 Set the conditional styles for a field, with the specified fieldName. More...
 
void setRowStyles (const QgsConditionalStyles &styles)
 Sets the conditional styles that apply to full rows of data in the attribute table. More...
 
bool writeXml (QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context) const
 Writes the condition styles state to a DOM node. More...
 

Detailed Description

The QgsConditionalLayerStyles class holds conditional style information for a layer.

This includes field styles and full row styles.

Definition at line 42 of file qgsconditionalstyle.h.

Constructor & Destructor Documentation

◆ QgsConditionalLayerStyles()

QgsConditionalLayerStyles::QgsConditionalLayerStyles ( QObject *  parent = nullptr)

Constructor for QgsConditionalLayerStyles, with the specified parent object.

Definition at line 24 of file qgsconditionalstyle.cpp.

Member Function Documentation

◆ changed

void QgsConditionalLayerStyles::changed ( )
signal

Emitted when the conditional styles are changed.

Since
QGIS 3.10

◆ constraintFailureStyles()

QgsConditionalStyle QgsConditionalLayerStyles::constraintFailureStyles ( QgsFieldConstraints::ConstraintStrength  strength)

Returns a style associated to a constraint failure.

Parameters
strengththe type of constraint
Since
QGIS 3.30

Definition at line 29 of file qgsconditionalstyle.cpp.

◆ fieldStyles()

QList< QgsConditionalStyle > QgsConditionalLayerStyles::fieldStyles ( const QString &  fieldName) const

Returns the conditional styles set for the field with matching fieldName.

See also
setFieldStyles()

Definition at line 79 of file qgsconditionalstyle.cpp.

◆ readXml()

bool QgsConditionalLayerStyles::readXml ( const QDomNode &  node,
const QgsReadWriteContext context 
)

Reads the condition styles state from a DOM node.

See also
writeXml()

Definition at line 128 of file qgsconditionalstyle.cpp.

◆ rowStyles()

QgsConditionalStyles QgsConditionalLayerStyles::rowStyles ( ) const

Returns a list of row styles associated with the layer.

See also
setRowStyles()

Definition at line 56 of file qgsconditionalstyle.cpp.

◆ rulesNeedGeometry()

bool QgsConditionalLayerStyles::rulesNeedGeometry ( ) const

Returns true if at least one rule needs geometry.

Since
QGIS 3.26.3

Definition at line 116 of file qgsconditionalstyle.cpp.

◆ setFieldStyles()

void QgsConditionalLayerStyles::setFieldStyles ( const QString &  fieldName,
const QList< QgsConditionalStyle > &  styles 
)

Set the conditional styles for a field, with the specified fieldName.

The field value is inserted into a 'value' variable to conduct expression checks.

See also
fieldStyles()

Definition at line 70 of file qgsconditionalstyle.cpp.

◆ setRowStyles()

void QgsConditionalLayerStyles::setRowStyles ( const QgsConditionalStyles styles)

Sets the conditional styles that apply to full rows of data in the attribute table.

Each row will check be checked against each rule.

See also
rowStyles()

Definition at line 61 of file qgsconditionalstyle.cpp.

◆ writeXml()

bool QgsConditionalLayerStyles::writeXml ( QDomNode &  node,
QDomDocument &  doc,
const QgsReadWriteContext context 
) const

Writes the condition styles state to a DOM node.

See also
readXml()

Definition at line 84 of file qgsconditionalstyle.cpp.


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