QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Member Functions | List of all members
QgsAttributes Class Reference

A vector of attributes. More...

#include <qgsattributes.h>

Inheritance diagram for QgsAttributes:
Inheritance graph
[legend]

Public Member Functions

 QgsAttributes ()=default
 Constructor for QgsAttributes. More...
 
 QgsAttributes (int size)
 Create a new vector of attributes with the given size. More...
 
 QgsAttributes (int size, const QVariant &v)
 Constructs a vector with an initial size of size elements. More...
 
 QgsAttributes (const QVector< QVariant > &v)
 Copies another vector of attributes. More...
 
bool operator!= (const QgsAttributes &v) const
 
bool operator== (const QgsAttributes &v) const
 Compares two vectors of attributes. More...
 
QgsAttributeMap toMap () const
 Returns a QgsAttributeMap of the attribute values. More...
 

Detailed Description

A vector of attributes.

Mostly equal to QVector<QVariant>.

Note
QgsAttributes is implemented as a Python list of Python objects.

Definition at line 57 of file qgsattributes.h.

Constructor & Destructor Documentation

QgsAttributes::QgsAttributes ( )
default

Constructor for QgsAttributes.

QgsAttributes::QgsAttributes ( int  size)
inline

Create a new vector of attributes with the given size.

Parameters
sizeNumber of attributes

Definition at line 69 of file qgsattributes.h.

QgsAttributes::QgsAttributes ( int  size,
const QVariant &  v 
)
inline

Constructs a vector with an initial size of size elements.

Each element is initialized with value.

Parameters
sizeNumber of elements
vInitial value

Definition at line 78 of file qgsattributes.h.

QgsAttributes::QgsAttributes ( const QVector< QVariant > &  v)
inline

Copies another vector of attributes.

Parameters
vAttributes to copy

Definition at line 86 of file qgsattributes.h.

Member Function Documentation

bool QgsAttributes::operator!= ( const QgsAttributes v) const
inline

Definition at line 120 of file qgsattributes.h.

bool QgsAttributes::operator== ( const QgsAttributes v) const
inline

Compares two vectors of attributes.

They are considered equal if all their members contain the same value and NULL flag. This was introduced because the default Qt implementation of QVariant comparison does not handle NULL values for certain types (like int).

Parameters
vThe attributes to compare
Returns
True if v is equal

Definition at line 99 of file qgsattributes.h.

QgsAttributeMap QgsAttributes::toMap ( ) const

Returns a QgsAttributeMap of the attribute values.

Null values are excluded from the map.

Note
not available in Python bindings
Since
QGIS 3.0

Definition at line 21 of file qgsattributes.cpp.


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