16 #ifndef QGSVECTORLAYERUTILS_H
17 #define QGSVECTORLAYERUTILS_H
19 #include "qgis_core.h"
73 QList<QgsVectorLayer *> layers()
const;
83 QMap<QgsVectorLayer *, QgsFeatureIds> mDuplicatedFeatures;
146 static QList< QVariant > getValues(
const QgsVectorLayer *layer,
const QString &fieldOrExpression,
bool &ok,
bool selectedOnly =
false,
QgsFeedback *feedback =
nullptr );
161 static QList< double > getDoubleValues(
const QgsVectorLayer *layer,
const QString &fieldOrExpression,
bool &ok,
bool selectedOnly =
false,
int *nullCount =
nullptr,
QgsFeedback *feedback =
nullptr );
176 static QVariant createUniqueValue(
const QgsVectorLayer *layer,
int fieldIndex,
const QVariant &seed = QVariant() );
184 static QVariant createUniqueValueFromCache(
const QgsVectorLayer *layer,
int fieldIndex,
const QSet<QVariant> &existingValues,
const QVariant &seed = QVariant() );
246 static std::unique_ptr<QgsVectorLayerFeatureSource> getFeatureSource( QPointer<QgsVectorLayer> layer,
QgsFeedback *feedback =
nullptr )
SIP_SKIP;
334 static
bool fieldIsReadOnly( const
QgsVectorLayer *layer,
int fieldIndex );
345 static
bool fieldEditabilityDependsOnFeature( const
QgsVectorLayer *layer,
int fieldIndex );
379 IgnoreAuxiliaryLayers = 1 << 1,
381 Q_DECLARE_FLAGS( CascadedFeatureFlags, CascadedFeatureFlag )
389 static bool impactsCascadeFeatures(
const QgsVectorLayer *layer,
const QgsFeatureIds &fids,
const QgsProject *project, QgsDuplicateFeatureContext &context
SIP_OUT, QgsVectorLayerUtils::CascadedFeatureFlags flags = QgsVectorLayerUtils::CascadedFeatureFlags() );
433 static QString guessFriendlyIdentifierField(
const QgsFields &fields,
bool *foundFriendly
SIP_OUT =
nullptr )
SIP_PYNAME( guessFriendlyIdentifierFieldV2 );
453 static QString guessFriendlyIdentifierField(
const QgsFields &fields );
459 #endif // QGSVECTORLAYERUTILS_H