QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsPointCloudAttributeModel Class Reference

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

#include <qgspointcloudattributemodel.h>

Inheritance diagram for QgsPointCloudAttributeModel:
Inheritance graph
[legend]

Public Types

enum class  CustomRole : int {
  AttributeName = Qt::UserRole + 1 , AttributeIndex , AttributeSize , AttributeType ,
  IsEmpty , IsNumeric
}
 Custom model roles. More...
 

Public Member Functions

 QgsPointCloudAttributeModel (QObject *parent=nullptr)
 Constructor for QgsPointCloudAttributeModel, with the specified parent object.
 
bool allowEmptyAttributeName () const
 Returns true if the model allows the empty attribute ("not set") choice.
 
QgsPointCloudAttributeCollection attributes () const
 Returns the attributes associated with the model.
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex indexFromName (const QString &name)
 Returns the index corresponding to a given attribute name.
 
QgsPointCloudLayerlayer ()
 Returns the layer associated with the model.
 
QModelIndex parent (const QModelIndex &child) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
void setAllowEmptyAttributeName (bool allowEmpty)
 Sets whether an optional empty attribute ("not set") option is present in the model.
 
void setAttributes (const QgsPointCloudAttributeCollection &attributes)
 Sets the attributes to include in the model.
 
void setLayer (QgsPointCloudLayer *layer)
 Sets the layer associated with the model.
 

Static Public Member Functions

static QString attributeToolTip (const QgsPointCloudAttribute &attribute)
 Returns a HTML formatted tooltip string for a attribute, containing details like the attribute name and type.
 
static QIcon iconForAttributeType (QgsPointCloudAttribute::DataType type)
 Returns an icon corresponding to an attribute type.
 

Detailed Description

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

Since
QGIS 3.18

Definition at line 36 of file qgspointcloudattributemodel.h.

Member Enumeration Documentation

◆ CustomRole

enum class QgsPointCloudAttributeModel::CustomRole : int
strong

Custom model roles.

Note
Prior to QGIS 3.36 this was available as QgsPointCloudAttributeModel::FieldRoles
Since
QGIS 3.36
Enumerator
AttributeName 

Attribute name.

AttributeIndex 

Attribute index if index corresponds to an attribute.

AttributeSize 

Attribute size.

AttributeType 

Attribute type, see QgsPointCloudAttribute::DataType.

IsEmpty 

true if the index corresponds to the empty value

IsNumeric 

true if the index corresponds to a numeric attributre

Definition at line 50 of file qgspointcloudattributemodel.h.

Constructor & Destructor Documentation

◆ QgsPointCloudAttributeModel()

QgsPointCloudAttributeModel::QgsPointCloudAttributeModel ( QObject *  parent = nullptr)
explicit

Constructor for QgsPointCloudAttributeModel, with the specified parent object.

Definition at line 25 of file qgspointcloudattributemodel.cpp.

Member Function Documentation

◆ allowEmptyAttributeName()

bool QgsPointCloudAttributeModel::allowEmptyAttributeName ( ) const
inline

Returns true if the model allows the empty attribute ("not set") choice.

See also
setAllowEmptyAttributeName()

Definition at line 111 of file qgspointcloudattributemodel.h.

◆ attributes()

QgsPointCloudAttributeCollection QgsPointCloudAttributeModel::attributes ( ) const
inline

Returns the attributes associated with the model.

See also
setAttributes()

Definition at line 94 of file qgspointcloudattributemodel.h.

◆ attributeToolTip()

QString QgsPointCloudAttributeModel::attributeToolTip ( const QgsPointCloudAttribute attribute)
static

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

Definition at line 221 of file qgspointcloudattributemodel.cpp.

◆ columnCount()

int QgsPointCloudAttributeModel::columnCount ( const QModelIndex &  parent) const
override

Definition at line 122 of file qgspointcloudattributemodel.cpp.

◆ data()

QVariant QgsPointCloudAttributeModel::data ( const QModelIndex &  index,
int  role 
) const
override

Definition at line 128 of file qgspointcloudattributemodel.cpp.

◆ iconForAttributeType()

QIcon QgsPointCloudAttributeModel::iconForAttributeType ( QgsPointCloudAttribute::DataType  type)
static

Returns an icon corresponding to an attribute type.

Definition at line 230 of file qgspointcloudattributemodel.cpp.

◆ index()

QModelIndex QgsPointCloudAttributeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Definition at line 96 of file qgspointcloudattributemodel.cpp.

◆ indexFromName()

QModelIndex QgsPointCloudAttributeModel::indexFromName ( const QString &  name)

Returns the index corresponding to a given attribute name.

Definition at line 76 of file qgspointcloudattributemodel.cpp.

◆ layer()

QgsPointCloudLayer * QgsPointCloudAttributeModel::layer ( )

Returns the layer associated with the model.

See also
setLayer()

Definition at line 45 of file qgspointcloudattributemodel.cpp.

◆ parent()

QModelIndex QgsPointCloudAttributeModel::parent ( const QModelIndex &  child) const
override

Definition at line 106 of file qgspointcloudattributemodel.cpp.

◆ rowCount()

int QgsPointCloudAttributeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 112 of file qgspointcloudattributemodel.cpp.

◆ setAllowEmptyAttributeName()

void QgsPointCloudAttributeModel::setAllowEmptyAttributeName ( bool  allowEmpty)

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

See also
allowEmptyAttributeName()

Definition at line 57 of file qgspointcloudattributemodel.cpp.

◆ setAttributes()

void QgsPointCloudAttributeModel::setAttributes ( const QgsPointCloudAttributeCollection attributes)

Sets the attributes to include in the model.

See also
setLayer()
attributes()

Definition at line 50 of file qgspointcloudattributemodel.cpp.

◆ setLayer()

void QgsPointCloudAttributeModel::setLayer ( QgsPointCloudLayer layer)

Sets the layer associated with the model.

See also
setAttributes()

Definition at line 31 of file qgspointcloudattributemodel.cpp.


The documentation for this class was generated from the following files: