Class: QgsFieldItem

A data item representing a single field from a layer.

Information about the connection URI, the schema and the table as well as the layer instance the field belongs to can be retrieved from the parent QgsFieldsItem object.

Added in version 3.16.

Class Hierarchy

Inheritance diagram of qgis.core.QgsFieldItem

Base classes

QgsDataItem

Base class for all items in the model.

QObject

Methods

field

Returns the field definition.

class qgis.core.QgsFieldItem[source]

Bases: QgsDataItem

__init__(parent: QgsDataItem | None, field: QgsField)

Constructor for QgsFieldItem, with the specified parent item and field.

Note

parent item must be a QgsFieldsItem

Parameters:
field(self) QgsField[source]

Returns the field definition.

Added in version 3.26.

Return type:

QgsField