Class: QgsPointCloudAttributeComboBox

The QgsPointCloudAttributeComboBox is a combo box which displays the list of attributes of a given point cloud layer. It might be combined with a QgsMapLayerComboBox to automatically update attributes according to a chosen layer.

Added in version 3.18.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsPointCloudAttributeComboBox

Base classes

QComboBox

QWidget

QObject

QPaintDevice

Methods

allowEmptyAttributeName

Returns True if the combo box allows the empty field ("not set") choice.

attributes

Returns the attributes currently shown in the combobox.

currentAttribute

Returns the currently selected attribute

filters

Returns the current filters used for filtering available attributes.

layer

Returns the layer currently associated with the combobox.

setAllowEmptyAttributeName

Sets whether an optional empty attribute ("not set") option is shown in the combo box.

setAttribute

Sets the currently selected attribute by name

setAttributes

Manually sets the attributes to use for the combo box.

setFilters

Sets filters to allow filtering available attributes according to the attribute properties.

setLayer

Sets the layer for which fields are listed in the combobox.

Signals

attributeChanged

Emitted when the currently selected attribute changes.

class qgis.gui.QgsPointCloudAttributeComboBox[source]

Bases: QComboBox

__init__(parent: QWidget | None = None)

QgsPointCloudAttributeComboBox creates a combo box to display the fields of a layer. The layer can be either manually given or dynamically set by connecting the signal QgsMapLayerComboBox.layerChanged to the slot setLayer.

Parameters:

parent (Optional[QWidget] = None)

allowEmptyAttributeName(self) bool[source]

Returns True if the combo box allows the empty field (“not set”) choice.

Return type:

bool

signal attributeChanged(name: str)[source]

Emitted when the currently selected attribute changes.

Parameters:

name (str)

attributes(self) QgsPointCloudAttributeCollection[source]

Returns the attributes currently shown in the combobox.

This will either be attributes from the associated layer() or the attributes manually set by a call to setAttributes().

Return type:

QgsPointCloudAttributeCollection

currentAttribute(self) str[source]

Returns the currently selected attribute

Return type:

str

filters(self) QgsPointCloudAttributeProxyModel.Filters[source]

Returns the current filters used for filtering available attributes.

See also

setFilters()

Return type:

QgsPointCloudAttributeProxyModel.Filters

layer(self) QgsPointCloudLayer | None[source]

Returns the layer currently associated with the combobox.

See also

setLayer()

Return type:

Optional[QgsPointCloudLayer]

setAllowEmptyAttributeName(self, allowEmpty: bool)[source]

Sets whether an optional empty attribute (“not set”) option is shown in the combo box.

Parameters:

allowEmpty (bool)

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

Sets the currently selected attribute by name

Parameters:

name (Optional[str])

setAttributes(self, attributes: QgsPointCloudAttributeCollection)[source]

Manually sets the attributes to use for the combo box.

This method should only be used when the combo box ISN’T associated with a layer() and needs to show the fields from an arbitrary attribute collection instead. Calling setAttributes() will automatically clear any existing layer().

See also

attributes()

Parameters:

attributes (QgsPointCloudAttributeCollection)

setFilters(self, filters: QgsPointCloudAttributeProxyModel.Filters | QgsPointCloudAttributeProxyModel.Filter)[source]

Sets filters to allow filtering available attributes according to the attribute properties.

See also

filters()

Parameters:

filters (Union[QgsPointCloudAttributeProxyModel.Filters, QgsPointCloudAttributeProxyModel.Filter])

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

Sets the layer for which fields are listed in the combobox. If no layer is set or a non-point cloud layer is set then the combobox will be empty.

See also

layer()

Parameters:

layer (Optional[QgsMapLayer])