QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
26 setModel( mProxyModel );
28 connect(
this,
static_cast < void ( QComboBox::* )(
int )
> ( &QComboBox::activated ),
this, &QgsPointCloudAttributeComboBox::indexChanged );
54 return mAttributeModel->
layer();
70 const QModelIndex idx = mAttributeModel->
indexFromName( name );
73 const QModelIndex proxyIdx = mProxyModel->mapFromSource( idx );
74 if ( proxyIdx.isValid() )
76 setCurrentIndex( proxyIdx.row() );
80 setCurrentIndex( -1 );
85 setCurrentIndex( -1 );
94 const int i = currentIndex();
96 const QModelIndex proxyIndex = mProxyModel->index( i, 0 );
97 if ( !proxyIndex.isValid() )
105 void QgsPointCloudAttributeComboBox::indexChanged(
int i )
@ AttributeNameRole
Attribute name.
Represents a map layer supporting display of point clouds.
void setAttributes(const QgsPointCloudAttributeCollection &attributes)
Sets the attributes to include in the model.
QgsPointCloudAttributeProxyModel * setFilters(QgsPointCloudAttributeProxyModel::Filters filters)
Set flags that affect how fields are filtered in the model.
QgsPointCloudAttributeComboBox(QWidget *parent=nullptr)
QgsPointCloudAttributeComboBox creates a combo box to display the fields of a layer.
bool allowEmptyAttributeName
QgsPointCloudLayer * layer()
Returns the layer associated with the model.
QModelIndex indexFromName(const QString &name)
Returns the index corresponding to a given attribute name.
void setAttribute(const QString &name)
Sets the currently selected attribute by name.
void setAllowEmptyAttributeName(bool allowEmpty)
Sets whether an optional empty attribute ("not set") option is shown in the combo box.
Collection of point cloud attributes.
QgsPointCloudAttributeProxyModel::Filters filters
void setFilters(QgsPointCloudAttributeProxyModel::Filters filters)
Sets filters to allow filtering available attributes according to the attribute properties.
void attributeChanged(const QString &name)
Emitted when the currently selected attribute changes.
QString currentAttribute() const
Returns the currently selected attribute.
QgsPointCloudAttributeCollection attributes() const
Returns the attributes associated with the model.
A proxy model for filtering available attributes from a point cloud attribute model.
QgsPointCloudLayer * layer() const
Returns the layer currently associated with the combobox.
A model for display of available attributes from a point cloud.
void setAllowEmptyAttributeName(bool allowEmpty)
Sets whether an optional empty attribute ("not set") option is present in the model.
Base class for all map layer types. This is the base class for all map layer types (vector,...
bool allowEmptyAttributeName() const
Returns true if the model allows the empty attribute ("not set") choice.
void setLayer(QgsPointCloudLayer *layer)
Sets the layer associated with the model.
void setAttributes(const QgsPointCloudAttributeCollection &attributes)
Manually sets the attributes to use for the combo box.
void setLayer(QgsMapLayer *layer)
Sets the layer for which fields are listed in the combobox.
QgsPointCloudAttributeCollection attributes() const
Returns the attributes currently shown in the combobox.