QGIS API Documentation
2.4.0-Chugiak
|
Class for parsing and evaluation of expressions (formerly called "search strings"). More...
#include <qgsexpression.h>
Classes | |
class | Function |
A abstract base class for defining QgsExpression functions. More... | |
class | Interval |
class | Node |
class | NodeBinaryOperator |
class | NodeColumnRef |
class | NodeCondition |
class | NodeFunction |
class | NodeInOperator |
class | NodeList |
class | NodeLiteral |
class | NodeUnaryOperator |
class | StaticFunction |
class | Visitor |
support for visitor pattern - algorithms dealing with the expressions may be implemented without modifying the Node classes More... | |
class | WhenThen |
Public Types | |
enum | UnaryOperator { uoNot, uoMinus } |
enum | BinaryOperator { boOr, boAnd, boEQ, boNE, boLE, boGE, boLT, boGT, boRegexp, boLike, boNotLike, boILike, boNotILike, boIs, boIsNot, boPlus, boMinus, boMul, boDiv, boMod, boPow, boConcat } |
enum | SpatialOperator { soBbox, soIntersects, soContains, soCrosses, soEquals, soDisjoint, soOverlaps, soTouches, soWithin } |
enum | NodeType { ntUnaryOperator, ntBinaryOperator, ntInOperator, ntFunction, ntLiteral, ntColumnRef, ntCondition } |
typedef QVariant(* | FcnEval )(const QVariantList &values, const QgsFeature *f, QgsExpression *parent) |
typedef QList< WhenThen * > | WhenThenList |
Public Member Functions | |
QgsExpression (const QString &expr) | |
~QgsExpression () | |
bool | hasParserError () const |
Returns true if an error occurred when parsing the input expression. More... | |
QString | parserErrorString () const |
Returns parser error. More... | |
const Node * | rootNode () const |
Returns root node of the expression. Root node is null is parsing has failed. More... | |
bool | prepare (const QgsFields &fields) |
Get the expression ready for evaluation - find out column indexes. More... | |
QStringList | referencedColumns () |
Get list of columns referenced by the expression. More... | |
bool | needsGeometry () |
Returns true if the expression uses feature geometry for some computation. More... | |
QVariant | evaluate (const QgsFeature *f=NULL) |
Evaluate the feature and return the result. More... | |
QVariant | evaluate (const QgsFeature &f) |
Evaluate the feature and return the result. More... | |
QVariant | evaluate (const QgsFeature *f, const QgsFields &fields) |
Evaluate the feature and return the result. More... | |
QVariant | evaluate (const QgsFeature &f, const QgsFields &fields) |
Evaluate the feature and return the result. More... | |
bool | hasEvalError () const |
Returns true if an error occurred when evaluating last input. More... | |
QString | evalErrorString () const |
Returns evaluation error. More... | |
void | setEvalErrorString (QString str) |
Set evaluation error (used internally by evaluation functions) More... | |
void | setCurrentRowNumber (int rowNumber) |
Set the number for $rownum special column. More... | |
int | currentRowNumber () |
Return the number used for $rownum special column. More... | |
void | setScale (double scale) |
double | scale () |
const QString | expression () const |
Alias for dump() More... | |
QString | dump () const |
Return the expression string that represents this QgsExpression. More... | |
QgsDistanceArea * | geomCalculator () |
Return calculator used for distance and area calculations (used by internal functions) More... | |
void | setGeomCalculator (const QgsDistanceArea &calc) |
Sets the geometry calculator used in evaluation of expressions,. More... | |
void | acceptVisitor (Visitor &v) const |
entry function for the visitor pattern More... | |
Static Public Member Functions | |
static void | setSpecialColumn (const QString &name, QVariant value) |
Assign a special column. More... | |
static void | unsetSpecialColumn (const QString &name) |
Unset a special column. More... | |
static QVariant | specialColumn (const QString &name) |
Return the value of the given special column or a null QVariant if undefined. More... | |
static bool | hasSpecialColumn (const QString &name) |
Check whether a special column exists. More... | |
static bool | isValid (const QString &text, const QgsFields &fields, QString &errorMessage) |
static QString | replaceExpressionText (const QString &action, const QgsFeature *feat, QgsVectorLayer *layer, const QMap< QString, QVariant > *substitutionMap=0) |
This function currently replaces each expression between [% and %] in the string with the result of its evaluation on the feature passed as argument. More... | |
static const QList< Function * > & | Functions () |
static const QStringList & | BuiltinFunctions () |
static bool | registerFunction (Function *function) |
static bool | unregisterFunction (QString name) |
static bool | isFunctionName (QString name) |
static int | functionIndex (QString name) |
static int | functionCount () |
Returns the number of functions defined in the parser. More... | |
static QList< Function * > | specialColumns () |
Returns a list of special Column definitions. More... | |
static QString | quotedColumnRef (QString name) |
return quoted column reference (in double quotes) More... | |
static QString | quotedString (QString text) |
return quoted string (in single quotes) More... | |
static QString | helptext (QString name) |
static QString | group (QString group) |
Static Public Attributes | |
static const char * | BinaryOperatorText [] |
static const char * | UnaryOperatorText [] |
static QList< Function * > | gmFunctions |
static QStringList | gmBuiltinFunctions |
Protected Member Functions | |
QgsExpression () | |
void | initGeomCalculator () |
Static Protected Member Functions | |
static void | initFunctionHelp () |
Protected Attributes | |
Node * | mRootNode |
QString | mParserErrorString |
QString | mEvalErrorString |
int | mRowNumber |
double | mScale |
QString | mExp |
QgsDistanceArea * | mCalc |
Static Protected Attributes | |
static QMap< QString, QVariant > | gmSpecialColumns |
static QHash< QString, QString > | gFunctionHelpTexts |
static QHash< QString, QString > | gGroups |
Friends | |
class | QgsOgcUtils |
Class for parsing and evaluation of expressions (formerly called "search strings").
The expressions try to follow both syntax and semantics of SQL expressions.
Usage:
QgsExpression exp("gid*2 > 10 and type not in ('D','F')); if (exp.hasParserError()) { show error message with parserErrorString() and exit } QVariant result = exp.evaluate(feature, fields); if (exp.hasEvalError()) { show error message with evalErrorString() } else { examine the result }
Possible QVariant value types:
Similarly to SQL, this class supports three-value logic: true/false/unknown. Unknown value may be a result of operations with missing data (NULL). Please note that NULL is different value than zero or an empty string. For example 3 > NULL returns unknown.
There is no special (three-value) 'boolean' type: true/false is represented as 1/0 integer, unknown value is represented the same way as NULL values: invalid QVariant.
For better performance with many evaluations you may first call prepare(fields) function to find out indices of columns and then repeatedly call evaluate(feature).
Type conversion: operators and functions that expect arguments to be of particular type automatically convert the arguments to that type, e.g. sin('2.1') will convert the argument to a double, length(123) will first convert the number to a string. Explicit conversion can be achieved with toint, toreal, tostring functions. If implicit or explicit conversion is invalid, the evaluation returns an error. Comparison operators do numeric comparison in case both operators are numeric (int/double) or they can be converted to numeric types.
Arithmetic operators do integer arithmetics if both operands are integer. That is 2+2 yields integer 4, but 2.0+2 returns real number 4.0. There are also two versions of division and modulo operators: 1.0/2 returns 0.5 while 1/2 returns 0.
Definition at line 89 of file qgsexpression.h.
typedef QVariant( * QgsExpression::FcnEval)(const QVariantList &values, const QgsFeature *f, QgsExpression *parent) |
Definition at line 238 of file qgsexpression.h.
typedef QList<WhenThen*> QgsExpression::WhenThenList |
Definition at line 562 of file qgsexpression.h.
Enumerator | |
---|---|
boOr | |
boAnd | |
boEQ | |
boNE | |
boLE | |
boGE | |
boLT | |
boGT | |
boRegexp | |
boLike | |
boNotLike | |
boILike | |
boNotILike | |
boIs | |
boIsNot | |
boPlus | |
boMinus | |
boMul | |
boDiv | |
boMod | |
boPow | |
boConcat |
Definition at line 190 of file qgsexpression.h.
Enumerator | |
---|---|
ntUnaryOperator | |
ntBinaryOperator | |
ntInOperator | |
ntFunction | |
ntLiteral | |
ntColumnRef | |
ntCondition |
Definition at line 327 of file qgsexpression.h.
Enumerator | |
---|---|
soBbox | |
soIntersects | |
soContains | |
soCrosses | |
soEquals | |
soDisjoint | |
soOverlaps | |
soTouches | |
soWithin |
Definition at line 222 of file qgsexpression.h.
Enumerator | |
---|---|
uoNot | |
uoMinus |
Definition at line 185 of file qgsexpression.h.
QgsExpression::QgsExpression | ( | const QString & | expr | ) |
Definition at line 1785 of file qgsexpression.cpp.
References mParserErrorString, mRootNode, and parseExpression().
QgsExpression::~QgsExpression | ( | ) |
Definition at line 1797 of file qgsexpression.cpp.
|
inlineprotected |
Definition at line 609 of file qgsexpression.h.
void QgsExpression::acceptVisitor | ( | QgsExpression::Visitor & | v | ) | const |
entry function for the visitor pattern
Definition at line 1892 of file qgsexpression.cpp.
References QgsExpression::Node::accept(), and mRootNode.
|
static |
Definition at line 1519 of file qgsexpression.cpp.
References gmBuiltinFunctions.
Referenced by unregisterFunction().
|
inline |
Return the number used for $rownum special column.
Definition at line 143 of file qgsexpression.h.
Referenced by fcnRowNumber().
QString QgsExpression::dump | ( | ) | const |
Return the expression string that represents this QgsExpression.
Definition at line 1884 of file qgsexpression.cpp.
References QgsExpression::Node::dump(), mRootNode, and tr.
Referenced by QgsOgcUtils::expressionFromOgcFilter().
|
inline |
Returns evaluation error.
Definition at line 136 of file qgsexpression.h.
Referenced by QgsSearchQueryBuilder::countRecords(), QgsPalLayerSettings::dataDefinedValue(), QgsComposerPicture::evalPictureExpression(), QgsAttributeAction::expandAction(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsDataDefined::prepareExpression(), QgsPalLabeling::prepareLayer(), QgsVectorLayer::readSldLabeling(), QgsPalLayerSettings::registerFeature(), and replaceExpressionText().
QVariant QgsExpression::evaluate | ( | const QgsFeature * | f = NULL | ) |
Evaluate the feature and return the result.
Definition at line 1861 of file qgsexpression.cpp.
References QgsExpression::Node::eval(), mEvalErrorString, mRootNode, and tr.
Referenced by QgsFeatureRequest::acceptFeature(), QgsSVGFillSymbolLayer::applyDataDefinedSettings(), QgsLinePatternFillSymbolLayer::applyDataDefinedSettings(), QgsPointPatternFillSymbolLayer::applyDataDefinedSettings(), QgsSimpleLineSymbolLayerV2::applyDataDefinedSymbology(), QgsSimpleFillSymbolLayerV2::applyDataDefinedSymbology(), QgsGradientFillSymbolLayerV2::applyDataDefinedSymbology(), QgsShapeburstFillSymbolLayerV2::applyDataDefinedSymbology(), QgsSearchQueryBuilder::countRecords(), QgsFeatureListModel::data(), QgsPalLayerSettings::dataDefinedValue(), QgsSimpleLineSymbolLayerV2::dxfColor(), QgsSimpleFillSymbolLayerV2::dxfColor(), QgsSimpleLineSymbolLayerV2::dxfWidth(), QgsSimpleFillSymbolLayerV2::dxfWidth(), QgsImageFillSymbolLayer::dxfWidth(), QgsComposerPicture::evalPictureExpression(), evaluate(), QgsAttributeAction::expandAction(), QgsVectorLayerFeatureIterator::fetchNextChangedAttributeFeature(), QgsComposerAttributeTable::getFeatureAttributes(), QgsMarkerSymbolLayerV2::markerOffset(), QgsAbstractFeatureIterator::nextFeatureFilterExpression(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsEllipseSymbolLayerV2::preparePath(), QgsPalLayerSettings::registerFeature(), QgsEllipseSymbolLayerV2::renderPoint(), QgsSimpleMarkerSymbolLayerV2::renderPoint(), QgsSvgMarkerSymbolLayerV2::renderPoint(), QgsMarkerLineSymbolLayerV2::renderPolyline(), QgsMarkerLineSymbolLayerV2::renderPolylineInterval(), QgsMarkerLineSymbolLayerV2::renderPolylineVertex(), replaceExpressionText(), QgsEllipseSymbolLayerV2::writeDxf(), QgsSimpleMarkerSymbolLayerV2::writeDxf(), and QgsSvgMarkerSymbolLayerV2::writeDxf().
|
inline |
Evaluate the feature and return the result.
Definition at line 122 of file qgsexpression.h.
References evaluate().
Referenced by evaluate().
QVariant QgsExpression::evaluate | ( | const QgsFeature * | f, |
const QgsFields & | fields | ||
) |
Evaluate the feature and return the result.
Definition at line 1873 of file qgsexpression.cpp.
References evaluate(), and prepare().
|
inline |
Evaluate the feature and return the result.
Definition at line 131 of file qgsexpression.h.
References evaluate().
Referenced by evaluate().
|
inline |
Alias for dump()
Definition at line 162 of file qgsexpression.h.
Referenced by QgsRuleBasedRendererV2::Rule::createFromSld(), QgsSymbolLayerV2::dataDefinedPropertyString(), QgsFeatureListModel::displayExpression(), QgsSymbolLayerV2Utils::fieldOrExpressionFromExpression(), QgsSymbolLayerV2Utils::functionFromSldElement(), QgsFeatureRequest::operator=(), and QgsEllipseSymbolLayerV2::writeSldMarker().
|
static |
Returns the number of functions defined in the parser.
Definition at line 1779 of file qgsexpression.cpp.
References Functions().
Referenced by functionIndex(), and QgsExpressionBuilderWidget::QgsExpressionBuilderWidget().
|
static |
Definition at line 1768 of file qgsexpression.cpp.
References functionCount(), and Functions().
Referenced by hasSpecialColumn(), isFunctionName(), QgsOgcUtils::nodeSpatialOperatorFromOgcFilter(), registerFunction(), setSpecialColumn(), specialColumn(), and unregisterFunction().
|
static |
Definition at line 1551 of file qgsexpression.cpp.
References fcnAbs(), fcnAcos(), fcnAge(), fcnAsin(), fcnAtan(), fcnAtan2(), fcnBbox(), fcnBounds(), fcnBoundsHeight(), fcnBoundsWidth(), fcnBuffer(), fcnCeil(), fcnCentroid(), fcnClamp(), fcnCoalesce(), fcnColorCmyk(), fcnColorHsl(), fcnColorHsv(), fcnColorRgb(), fcnCombine(), fcnConcat(), fcnContains(), fcnConvexHull(), fcnCos(), fcnCrosses(), fcnDay(), fcnDifference(), fcnDisjoint(), fcnDistance(), fcnExp(), fcnExpScale(), fcnFeatureId(), fcnFloor(), fcnFormatDate(), fcnFormatNumber(), fcnFormatString(), fcnGeomArea(), fcnGeometry(), fcnGeomFromGML(), fcnGeomFromWKT(), fcnGeomLength(), fcnGeomPerimeter(), fcnGeomToWKT(), fcnHour(), fcnIntersection(), fcnIntersects(), fcnLeft(), fcnLength(), fcnLinearScale(), fcnLn(), fcnLog(), fcnLog10(), fcnLower(), fcnLPad(), fcnMax(), fcnMin(), fcnMinute(), fcnMonth(), fcnNow(), fcnOverlaps(), fcnPi(), fcnRampColor(), fcnRegexpMatch(), fcnRegexpReplace(), fcnRegexpSubstr(), fcnReplace(), fcnRight(), fcnRnd(), fcnRndF(), fcnRound(), fcnRowNumber(), fcnRPad(), fcnScale(), fcnSeconds(), fcnSin(), fcnSpecialColumn(), fcnSqrt(), fcnStrpos(), fcnSubstr(), fcnSymDifference(), fcnTan(), fcnTitle(), fcnToDate(), fcnToDateTime(), fcnToInt(), fcnToInterval(), fcnToReal(), fcnToString(), fcnToTime(), fcnTouches(), fcnTrim(), fcnUpper(), fcnUuid(), fcnWeek(), fcnWithin(), fcnWordwrap(), fcnX(), fcnXat(), fcnXMax(), fcnXMin(), fcnY(), fcnYat(), fcnYear(), fcnYMax(), fcnYMin(), fncColorCmyka(), fncColorHsla(), fncColorHsva(), fncColorRgba(), and gmFunctions.
Referenced by QgsExpression::NodeFunction::dump(), QgsExpression::NodeFunction::eval(), QgsOgcUtils::expressionFunctionToOgcFilter(), functionCount(), functionIndex(), geometryFromConstExpr(), isGeometryColumn(), QgsExpression::NodeFunction::needsGeometry(), QgsOgcUtils::nodeFunctionFromOgcFilter(), and QgsExpressionBuilderWidget::QgsExpressionBuilderWidget().
|
inline |
Return calculator used for distance and area calculations (used by internal functions)
Definition at line 169 of file qgsexpression.h.
Referenced by fcnGeomArea(), fcnGeomLength(), and fcnGeomPerimeter().
|
static |
Definition at line 2586 of file qgsexpression.cpp.
Referenced by QgsExpressionBuilderWidget::registerItem().
|
inline |
Returns true if an error occurred when evaluating last input.
Definition at line 134 of file qgsexpression.h.
Referenced by QgsSearchQueryBuilder::countRecords(), QgsPalLayerSettings::dataDefinedValue(), QgsComposerPicture::evalPictureExpression(), QgsAttributeAction::expandAction(), QgsComposerPicture::loadPicture(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsDataDefined::prepareExpression(), QgsPalLabeling::prepareLayer(), QgsVectorLayer::readSldLabeling(), QgsPalLayerSettings::registerFeature(), and replaceExpressionText().
|
inline |
Returns true if an error occurred when parsing the input expression.
Definition at line 96 of file qgsexpression.h.
Referenced by QgsDataDefinedButton::aboutToShowMenu(), QgsSearchQueryBuilder::countRecords(), QgsRuleBasedRendererV2::Rule::createFromSld(), QgsSymbolLayerV2Utils::createFunctionElement(), QgsFieldModel::data(), QgsAttributeAction::expandAction(), QgsSymbolLayerV2Utils::fieldOrExpressionToExpression(), QgsSymbolLayerV2Utils::functionFromSldElement(), QgsFieldExpressionWidget::isExpressionValid(), isValid(), QgsSearchQueryBuilder::loadQuery(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsDataDefined::prepareExpression(), QgsPalLayerSettings::registerFeature(), replaceExpressionText(), QgsFeatureListModel::setDisplayExpression(), QgsDataDefinedButton::updateGui(), QgsComposerPicture::updatePictureExpression(), QgsGraduatedSymbolRendererV2::usedAttributes(), and QgsCategorizedSymbolRendererV2::usedAttributes().
|
static |
Check whether a special column exists.
Definition at line 1709 of file qgsexpression.cpp.
References functionIndex(), gmSpecialColumns, and setSpecialColumn().
|
static |
Definition at line 2578 of file qgsexpression.cpp.
References gFunctionHelpTexts, initFunctionHelp(), and tr.
Referenced by QgsExpression::Function::helptext(), and QgsExpressionBuilderWidget::loadFunctionHelp().
|
staticprotected |
Definition at line 6 of file qgsexpression_texts.cpp.
References gFunctionHelpTexts.
Referenced by helptext().
|
protected |
Definition at line 1833 of file qgsexpression.cpp.
References mCalc, and QgsDistanceArea::setEllipsoidalMode().
|
static |
Definition at line 1763 of file qgsexpression.cpp.
References functionIndex().
|
static |
Definition at line 1731 of file qgsexpression.cpp.
References hasParserError(), parserErrorString(), and prepare().
Referenced by isIntervalSafe(), and QgsFieldExpressionWidget::isValidExpression().
bool QgsExpression::needsGeometry | ( | ) |
Returns true if the expression uses feature geometry for some computation.
Definition at line 1826 of file qgsexpression.cpp.
References mRootNode, and QgsExpression::Node::needsGeometry().
Referenced by QgsSearchQueryBuilder::countRecords().
|
inline |
Returns parser error.
Definition at line 98 of file qgsexpression.h.
Referenced by QgsSearchQueryBuilder::countRecords(), QgsRuleBasedRendererV2::Rule::createFromSld(), QgsSymbolLayerV2Utils::createFunctionElement(), QgsAttributeAction::expandAction(), QgsSymbolLayerV2Utils::functionFromSldElement(), isValid(), QgsSearchQueryBuilder::loadQuery(), QgsExpressionBuilderWidget::on_txtExpressionString_textChanged(), QgsDataDefined::prepareExpression(), QgsPalLayerSettings::registerFeature(), replaceExpressionText(), QgsFeatureListModel::setDisplayExpression(), QgsDataDefinedButton::updateGui(), and QgsComposerPicture::updatePictureExpression().
bool QgsExpression::prepare | ( | const QgsFields & | fields | ) |
Get the expression ready for evaluation - find out column indexes.
Definition at line 1849 of file qgsexpression.cpp.
References mEvalErrorString, mRootNode, QgsExpression::Node::prepare(), and tr.
Referenced by QgsSearchQueryBuilder::countRecords(), QgsFieldModel::data(), evaluate(), QgsComposerAttributeTable::getFeatureAttributes(), QgsFieldExpressionWidget::isExpressionValid(), isValid(), QgsExpressionSelectionDialog::on_mActionAddToSelection_triggered(), QgsExpressionSelectionDialog::on_mActionRemoveFromSelection_triggered(), QgsExpressionSelectionDialog::on_mActionSelect_triggered(), QgsExpressionSelectionDialog::on_mActionSelectInstersect_triggered(), QgsDataDefined::prepareExpression(), QgsPalLabeling::prepareLayer(), QgsVectorLayerFeatureIterator::QgsVectorLayerFeatureIterator(), QgsFeatureListModel::setDisplayExpression(), and QgsComposerPicture::updatePictureExpression().
|
static |
return quoted column reference (in double quotes)
Definition at line 1749 of file qgsexpression.cpp.
Referenced by QgsExpression::NodeColumnRef::dump(), QgsSymbolLayerV2Utils::fieldOrExpressionToExpression(), QgsSearchQueryBuilder::on_lstFields_doubleClicked(), QgsRuleBasedRendererV2::refineRuleCategories(), and QgsRuleBasedRendererV2::refineRuleRanges().
|
static |
return quoted string (in single quotes)
Definition at line 1754 of file qgsexpression.cpp.
Referenced by QgsExpression::NodeLiteral::dump(), and QgsRuleBasedRendererV2::refineRuleCategories().
QStringList QgsExpression::referencedColumns | ( | ) |
Get list of columns referenced by the expression.
Definition at line 1803 of file qgsexpression.cpp.
References mRootNode, and QgsExpression::Node::referencedColumns().
Referenced by QgsVectorLayerRenderer::prepareDiagrams(), QgsDataDefined::prepareExpression(), QgsPalLabeling::prepareLayer(), QgsGraduatedSymbolRendererV2::usedAttributes(), and QgsCategorizedSymbolRendererV2::usedAttributes().
|
static |
Definition at line 1488 of file qgsexpression.cpp.
References functionIndex(), and gmFunctions.
|
static |
This function currently replaces each expression between [% and %] in the string with the result of its evaluation on the feature passed as argument.
Additional substitutions can be passed through the substitutionMap parameter
Definition at line 1898 of file qgsexpression.cpp.
References evalErrorString(), evaluate(), hasEvalError(), hasParserError(), index, parserErrorString(), QgsVectorLayer::pendingFields(), QgsDebugMsg, setSpecialColumn(), and specialColumn().
Referenced by QgsComposerLabel::displayText(), QgsAttributeAction::doAction(), QgsMapTip::fetchFeature(), and QgsHtmlAnnotationItem::setFeatureForMapPosition().
|
inline |
Returns root node of the expression. Root node is null is parsing has failed.
Definition at line 103 of file qgsexpression.h.
Referenced by QgsOgcUtils::expressionToOgcFilter(), and QgsSymbolLayerV2Utils::fieldOrExpressionFromExpression().
|
inline |
Definition at line 159 of file qgsexpression.h.
Referenced by fcnScale().
|
inline |
Set the number for $rownum special column.
Definition at line 141 of file qgsexpression.h.
Referenced by QgsComposerAttributeTable::getFeatureAttributes().
|
inline |
Set evaluation error (used internally by evaluation functions)
Definition at line 138 of file qgsexpression.h.
Referenced by QgsExpression::NodeBinaryOperator::eval(), fcnColorCmyk(), fcnColorHsl(), fcnColorHsv(), fcnColorRgb(), fcnExpScale(), fcnLinearScale(), fcnRampColor(), fcnRegexpMatch(), fcnRegexpReplace(), fcnRegexpSubstr(), fncColorCmyka(), fncColorHsla(), fncColorHsva(), fncColorRgba(), getDateTimeValue(), getDateValue(), getDoubleValue(), getGeometry(), getInterval(), getIntValue(), getTimeValue(), getTVLValue(), and pointAt().
void QgsExpression::setGeomCalculator | ( | const QgsDistanceArea & | calc | ) |
Sets the geometry calculator used in evaluation of expressions,.
Definition at line 1843 of file qgsexpression.cpp.
References mCalc.
Referenced by QgsExpressionBuilderWidget::on_txtExpressionString_textChanged().
|
inline |
Definition at line 157 of file qgsexpression.h.
Referenced by QgsDataDefined::prepareExpression(), and QgsPalLayerSettings::registerFeature().
|
static |
Assign a special column.
Definition at line 1673 of file qgsexpression.cpp.
References functionIndex(), and gmSpecialColumns.
Referenced by QgsComposition::addPaperItem(), QgsAtlasComposition::beginRender(), QgsComposerMap::draw(), hasSpecialColumn(), QgsAtlasComposition::prepareForFeature(), QgsAtlasComposition::QgsAtlasComposition(), QgsMapCanvas::refreshMap(), QgsComposition::removePaperItems(), replaceExpressionText(), QgsAtlasComposition::setCoverageLayer(), QgsComposition::setNumPages(), and QgsAtlasComposition::updateFeatures().
|
static |
Return the value of the given special column or a null QVariant if undefined.
Definition at line 1693 of file qgsexpression.cpp.
References functionIndex(), and gmSpecialColumns.
Referenced by fcnSpecialColumn(), and replaceExpressionText().
|
static |
Returns a list of special Column definitions.
Definition at line 1739 of file qgsexpression.cpp.
References gmSpecialColumns.
Referenced by QgsExpressionBuilderWidget::QgsExpressionBuilderWidget().
|
static |
Definition at line 1499 of file qgsexpression.cpp.
References BuiltinFunctions(), functionIndex(), and gmFunctions.
|
static |
Unset a special column.
Definition at line 1684 of file qgsexpression.cpp.
References gmSpecialColumns.
|
friend |
Definition at line 625 of file qgsexpression.h.
|
static |
Definition at line 235 of file qgsexpression.h.
Referenced by QgsExpression::NodeBinaryOperator::dump(), and QgsOgcUtils::expressionBinaryOperatorToOgcFilter().
|
staticprotected |
Definition at line 628 of file qgsexpression.h.
Referenced by helptext(), and initFunctionHelp().
|
staticprotected |
Definition at line 629 of file qgsexpression.h.
Referenced by group().
|
static |
Definition at line 296 of file qgsexpression.h.
Referenced by BuiltinFunctions().
|
static |
Definition at line 294 of file qgsexpression.h.
Referenced by Functions(), registerFunction(), and unregisterFunction().
|
staticprotected |
Definition at line 622 of file qgsexpression.h.
Referenced by hasSpecialColumn(), setSpecialColumn(), specialColumn(), specialColumns(), and unsetSpecialColumn().
|
protected |
Definition at line 623 of file qgsexpression.h.
Referenced by initGeomCalculator(), setGeomCalculator(), and ~QgsExpression().
|
protected |
Definition at line 616 of file qgsexpression.h.
Referenced by evaluate(), prepare(), and QgsExpression::NodeColumnRef::prepare().
|
protected |
Definition at line 620 of file qgsexpression.h.
Referenced by QgsOgcUtils::expressionFromOgcFilter().
|
protected |
Definition at line 615 of file qgsexpression.h.
Referenced by QgsOgcUtils::expressionFromOgcFilter(), and QgsExpression().
|
protected |
Definition at line 613 of file qgsexpression.h.
Referenced by acceptVisitor(), dump(), evaluate(), QgsOgcUtils::expressionFromOgcFilter(), needsGeometry(), prepare(), QgsExpression(), referencedColumns(), and ~QgsExpression().
|
protected |
Definition at line 618 of file qgsexpression.h.
|
protected |
Definition at line 619 of file qgsexpression.h.
|
static |
Definition at line 236 of file qgsexpression.h.
Referenced by QgsExpression::NodeUnaryOperator::dump(), and QgsOgcUtils::expressionUnaryOperatorToOgcFilter().