40 return new QgsDummyConfigDlg( vl, fieldIdx, parent, QObject::tr(
"Key/Value field" ) );
46 if ( field.
type() == QMetaType::Type::QVariantMap && ( field.
typeName().compare( QStringLiteral(
"JSON" ), Qt::CaseSensitivity::CaseInsensitive ) == 0 || field.
subType() == QMetaType::Type::QString ) )
49 const int MAX_FEATURE_LIMIT { 20 };
58 while ( featureIt.nextFeature( f ) )
61 if ( featureCount > MAX_FEATURE_LIMIT )
66 const QVariant value( f.
attribute( fieldIdx ) );
67 if ( ! value.isNull() )
69 switch ( value.type() )
71 case QVariant::Type::Map:
76 case QVariant::Type::String:
78 const QJsonDocument doc = QJsonDocument::fromJson( value.toString().toUtf8() );
92 return field.
type() == QMetaType::Type::QVariantMap && field.
subType() != QMetaType::Type::UnknownType ? 20 : 0;
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
Wrapper for iterator of features from vector data provider or vector layer.
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setFlags(Qgis::FeatureRequestFlags flags)
Sets flags that affect how features will be fetched.
QgsFeatureRequest & setLimit(long long limit)
Set the maximum number of features to request.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Q_INVOKABLE QVariant attribute(const QString &name) const
Lookup attribute value by attribute name.
Encapsulate a field in an attribute table or data source.
QString typeName() const
Gets the field type.
QMetaType::Type subType() const
If the field is a collection, gets its element's type.
QgsField field(int fieldIdx) const
Returns the field at particular index (must be in range 0..N-1).
Represents a vector layer which manages a vector based data sets.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.