26 if ( a.size() != b.size() )
29 for (
int i = 0; i < a.size(); ++i )
48 return mIdentifierFields.value( 0 );
51 void QgsFeatureFilterModel::requestToReloadCurrentFeature(
QgsFeatureRequest &request )
53 QStringList conditions;
54 for (
int i = 0; i < mIdentifierFields.count(); i++ )
68 QSet<QString> QgsFeatureFilterModel::requestedAttributes()
const
70 return qgis::listToSet( mIdentifierFields );
73 QVariant QgsFeatureFilterModel::entryIdentifier(
const QgsFeatureExpressionValuesGatherer::Entry &entry )
const
75 return entry.featureId;
78 QgsFeatureExpressionValuesGatherer::Entry QgsFeatureFilterModel::createEntry(
const QVariant &identifier )
const
80 const QVariantList constValues = identifier.toList();
83 for (
const QVariant &v : constValues )
84 values << QStringLiteral(
"(%1)" ).arg( v.toString() );
86 return QgsFeatureExpressionValuesGatherer::Entry( constValues, values.join( QStringLiteral(
" " ) ),
QgsFeature(
sourceLayer()->fields() ) );
89 bool QgsFeatureFilterModel::compareEntries(
const QgsFeatureExpressionValuesGatherer::Entry &a,
const QgsFeatureExpressionValuesGatherer::Entry &b )
const
94 bool QgsFeatureFilterModel::identifierIsNull(
const QVariant &identifier )
const
96 const QVariantList values = identifier.toList();
97 for (
const QVariant &value : values )
99 if ( !value.isNull() )
107 QVariant QgsFeatureFilterModel::nullIentifier()
const
109 QVariantList nullValues;
110 for (
int i = 0; i < mIdentifierFields.count(); i++ )
111 nullValues << QVariant( QVariant::Int );
117 return mIdentifierFields;
131 QgsFeatureExpressionValuesGatherer *QgsFeatureFilterModel::createValuesGatherer(
const QgsFeatureRequest &request )
const
140 if ( values.count() != mIdentifierFields.count() )
142 return nullIentifier().toList();