Class: QgsPointCloudAttributeModel

A model for display of available attributes from a point cloud.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.core.QgsPointCloudAttributeModel

Base classes

QAbstractItemModel

QObject

class qgis.core.QgsPointCloudAttributeModel[source]

Bases: QAbstractItemModel

__init__(parent: QObject | None = None)

Constructor for QgsPointCloudAttributeModel, with the specified parent object.

Parameters:

parent (Optional[QObject] = None)

class CustomRole(*values)

Bases: IntEnum

Custom model roles.

Note

Prior to QGIS 3.36 this was available as QgsPointCloudAttributeModel.FieldRoles

Added in version 3.36.

  • AttributeName: Attribute name

    Available as QgsPointCloudAttributeModel.AttributeNameRole in older QGIS releases.

  • AttributeIndex: Attribute index if index corresponds to an attribute

    Available as QgsPointCloudAttributeModel.AttributeIndexRole in older QGIS releases.

  • AttributeSize: Attribute size

    Available as QgsPointCloudAttributeModel.AttributeSizeRole in older QGIS releases.

  • AttributeType: Attribute type, see QgsPointCloudAttribute.DataType

    Available as QgsPointCloudAttributeModel.AttributeTypeRole in older QGIS releases.

  • IsEmpty: True if the index corresponds to the empty value

    Available as QgsPointCloudAttributeModel.IsEmptyRole in older QGIS releases.

  • IsNumeric: True if the index corresponds to a numeric attributre

    Available as QgsPointCloudAttributeModel.IsNumericRole in older QGIS releases.

FieldRoles

alias of CustomRole

allowEmptyAttributeName(self) bool[source]

Returns True if the model allows the empty attribute (“not set”) choice.

Return type:

bool

static attributeToolTip(attribute: QgsPointCloudAttribute) str[source]

Returns a HTML formatted tooltip string for a attribute, containing details like the attribute name and type.

Parameters:

attribute (QgsPointCloudAttribute)

Return type:

str

attributes(self) QgsPointCloudAttributeCollection[source]

Returns the attributes associated with the model.

See also

setAttributes()

Return type:

QgsPointCloudAttributeCollection

static iconForAttributeType(type: QgsPointCloudAttribute.DataType) QIcon[source]

Returns an icon corresponding to an attribute type

Parameters:

type (QgsPointCloudAttribute.DataType)

Return type:

QIcon

indexFromName(self, name: str | None) QModelIndex[source]

Returns the index corresponding to a given attribute name.

Parameters:

name (Optional[str])

Return type:

QModelIndex

layer(self) QgsPointCloudLayer | None[source]

Returns the layer associated with the model.

See also

setLayer()

Return type:

Optional[QgsPointCloudLayer]

setAllowEmptyAttributeName(self, allowEmpty: bool)[source]

Sets whether an optional empty attribute (“not set”) option is present in the model.

Parameters:

allowEmpty (bool)

setAttributes(self, attributes: QgsPointCloudAttributeCollection)[source]

Sets the attributes to include in the model.

See also

setLayer()

See also

attributes()

Parameters:

attributes (QgsPointCloudAttributeCollection)

setLayer(self, layer: QgsPointCloudLayer | None)[source]

Sets the layer associated with the model.

See also

setAttributes()

Parameters:

layer (Optional[QgsPointCloudLayer])