QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
24 QgsExpressionUtils::TVL QgsExpressionUtils::AND[3][3] =
27 { False, False, False },
28 { False, True, Unknown },
29 { False, Unknown, Unknown }
31 QgsExpressionUtils::TVL QgsExpressionUtils::OR[3][3] =
33 { False, True, Unknown },
35 { Unknown, True, Unknown }
38 QgsExpressionUtils::TVL QgsExpressionUtils::NOT[3] = { True, False, Unknown };
48 parent->
setEvalErrorString( QObject::tr(
"Cannot convert '%1' to gradient ramp" ).arg( value.toString() ) );
53 QString QgsExpressionUtils::getFilePathValue(
const QVariant &value,
QgsExpression *parent )
57 if (
QgsMapLayer *layer = getMapLayer( value, parent ) )
60 res = parts.value( QStringLiteral(
"path" ) ).toString();
64 res = value.toString();
66 if ( res.isEmpty() && !value.isNull() )
89 *foundFeatures = hasFeature;
93 const QVariant value = exp.
evaluate( &context );
94 if ( !value.isNull() )
96 return std::make_tuple( value.type(), value.userType() );
101 return std::make_tuple( value.type(), value.userType() );
@ NoGeometry
Geometry is not required. It may still be returned if e.g. required for a filter condition.
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Gradient color ramp, which smoothly interpolates between two colors and also supports optional extra ...
double value(int index) const override
Returns relative value between [0,1] of color at specified index.
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
void setEvalErrorString(const QString &str)
Sets evaluation error (used internally by evaluation functions)
This class wraps a request for features to a vector layer (or directly its vector data provider).
QVariantMap decodeUri(const QString &providerKey, const QString &uri)
Breaks a provider data source URI into its component paths (e.g.
QVariant evaluate()
Evaluate the feature and return the result.
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.
bool nextFeature(QgsFeature &f)
Represents a vector layer which manages a vector based data sets.
QgsFeatureRequest & setLimit(long long limit)
Set the maximum number of features to request.
Base class for all map layer types. This is the base class for all map layer types (vector,...
bool needsGeometry() const
Returns true if the expression uses feature geometry for some computation.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Class for parsing and evaluation of expressions (formerly called "search strings")....
Wrapper for iterator of features from vector data provider or vector layer.
static QgsProviderRegistry * instance(const QString &pluginPath=QString())
Means of accessing canonical single instance.
QgsFeatureRequest & setFlags(QgsFeatureRequest::Flags flags)
Sets flags that affect how features will be fetched.
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.