QgsQuickFeatureLayerPair class

Pair of QgsFeature and QgsVectorLayer.

Vector layer is commonly used to gather geometry type or CRS for the feature.

Note that the feature may or may not be part of the layer's features

Constructors, destructors, conversion operators

QgsQuickFeatureLayerPair()
Constructs invalid feature-layer pair.
QgsQuickFeatureLayerPair(const QgsFeature& feature, QgsVectorLayer* layer)
Constructor of a new feature-layer pair.

Public functions

auto feature() const -> QgsFeature
Feature that belongs to layer.
auto featureRef() -> QgsFeature&
Feature that belongs to layer.
auto isValid() const -> bool
Whether.
auto layer() const -> QgsVectorLayer*
Vector layer to which the feature belongs.

Function documentation

QgsQuickFeatureLayerPair::QgsQuickFeatureLayerPair(const QgsFeature& feature, QgsVectorLayer* layer)

Constructor of a new feature-layer pair.

Parameters
feature QgsFeature associated.
layer Vector layer which the feature belongs to

QgsFeature QgsQuickFeatureLayerPair::feature() const

Feature that belongs to layer.

This is a readonly property.

QgsFeature& QgsQuickFeatureLayerPair::featureRef()

Feature that belongs to layer.

This is a readonly property.

bool QgsQuickFeatureLayerPair::isValid() const

Whether.

  • layer is not nullptr
  • feature is valid
  • feature has geometry and the geometry is the same as geometry expected by layer

This is a readonly property.

QgsVectorLayer* QgsQuickFeatureLayerPair::layer() const

Vector layer to which the feature belongs.

May be nullptr if pair is not valid

This is a readonly property.