Class: QgsCodedValue

Associates a code and a value.

Added in version 3.26.

Methods

code

Returns the associated code, which is the underlying value stored in fields.

value

Returns the associated value, which is the user-friendly string representation.

class qgis.core.QgsCodedValue[source]

Bases: object

__init__(code: Any, value: str | None)

Constructor for QgsCodedValue, with the associated code and value.

The code is the underlying value stored in feature attributes, while the value is the user-facing string representation.

Parameters:
  • code (Any)

  • value (Optional[str])

__init__(a0: QgsCodedValue)
Parameters:

a0 (QgsCodedValue)

code(self) Any[source]

Returns the associated code, which is the underlying value stored in fields.

Return type:

Any

value(self) str[source]

Returns the associated value, which is the user-friendly string representation.

Return type:

str