22 QgsExpressionUtils::TVL QgsExpressionUtils::AND[3][3] =
25 { False, False, False },
26 { False, True, Unknown },
27 { False, Unknown, Unknown }
29 QgsExpressionUtils::TVL QgsExpressionUtils::OR[3][3] =
31 { False, True, Unknown },
33 { Unknown, True, Unknown }
36 QgsExpressionUtils::TVL QgsExpressionUtils::NOT[3] = { True, False, Unknown };
54 *foundFeatures = hasFeature;
58 const QVariant value = exp.
evaluate( &context );
59 if ( !value.isNull() )
61 return std::make_tuple( value.type(), value.userType() );
66 return std::make_tuple( value.type(), value.userType() );
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
static std::tuple< QVariant::Type, int > determineResultType(const QString &expression, const QgsVectorLayer *layer, QgsFeatureRequest request=QgsFeatureRequest(), QgsExpressionContext context=QgsExpressionContext(), bool *foundFeatures=nullptr)
Returns a value type and user type for a given expression.
Class for parsing and evaluation of expressions (formerly called "search strings").
bool needsGeometry() const
Returns true if the expression uses feature geometry for some computation.
QVariant evaluate()
Evaluate the feature and return the result.
Wrapper for iterator of features from vector data provider or vector layer.
bool nextFeature(QgsFeature &f)
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setLimit(long long limit)
Set the maximum number of features to request.
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
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.