@@ -8,7 +8,7 @@ class QgsExpression
8
8
/**
9
9
* Creates a new expression based on the provided string.
10
10
* The string will immediately be parsed. For optimization
11
- * {@link prepare()} should alwys be called before every
11
+ * {@link prepare()} should always be called before every
12
12
* loop in which this expression is used.
13
13
*/
14
14
QgsExpression( const QString& expr );
@@ -49,7 +49,8 @@ class QgsExpression
49
49
50
50
/**
51
51
* Get list of columns referenced by the expression.
52
- * @note if the returned list contains the QgsFeatureRequest::AllAttributes constant then
52
+ *
53
+ * @note If the returned list contains the QgsFeatureRequest::AllAttributes constant then
53
54
* all attributes from the layer are required for evaluation of the expression.
54
55
* QgsFeatureRequest::setSubsetOfAttributes automatically handles this case.
55
56
*
@@ -146,17 +147,17 @@ class QgsExpression
146
147
*/
147
148
static bool isValid( const QString& text, const QgsExpressionContext* context, QString &errorMessage );
148
149
149
- void setScale( double scale );
150
-
151
- double scale();
152
-
153
150
/**
154
151
* Set the expression string, will reset the whole internal structure.
155
152
*
156
153
* @note Added in QGIS 2.18
157
154
*/
158
155
void setExpression( const QString& expression );
159
156
157
+ void setScale( double scale );
158
+
159
+ double scale();
160
+
160
161
//! Return the original, unmodified expression string.
161
162
//! If there was none supplied because it was constructed by sole
162
163
//! API calls, dump() will be used to create one instead.
@@ -172,6 +173,7 @@ class QgsExpression
172
173
* (used by $length, $area and $perimeter functions only)
173
174
* @see setGeomCalculator()
174
175
* @see distanceUnits()
176
+ * @see areaUnits()
175
177
*/
176
178
QgsDistanceArea *geomCalculator();
177
179
@@ -188,13 +190,15 @@ class QgsExpression
188
190
* @note distances are only converted when a geomCalculator() has been set
189
191
* @note added in QGIS 2.14
190
192
* @see setDistanceUnits()
193
+ * @see areaUnits()
191
194
*/
192
195
QGis::UnitType distanceUnits() const;
193
196
194
197
/** Sets the desired distance units for calculations involving geomCalculator(), eg "$length" and "$perimeter".
195
198
* @note distances are only converted when a geomCalculator() has been set
196
199
* @note added in QGIS 2.14
197
200
* @see distanceUnits()
201
+ * @see setAreaUnits()
198
202
*/
199
203
void setDistanceUnits( QGis::UnitType unit );
200
204
@@ -358,7 +362,7 @@ class QgsExpression
358
362
//! List of parameters, used for function definition
359
363
typedef QList< QgsExpression::Parameter > ParameterList;
360
364
361
- /**
365
+ /** \ingroup core
362
366
* A abstract base class for defining QgsExpression functions.
363
367
*/
364
368
class Function
@@ -377,7 +381,7 @@ class QgsExpression
377
381
bool isContextual = false );
378
382
379
383
/** Constructor for function which uses unnamed parameters and group list
380
- * @note added in QGIS 3.0
384
+ * @note added in QGIS 2.18
381
385
*/
382
386
Function( const QString& fnname,
383
387
int params,
@@ -403,7 +407,7 @@ class QgsExpression
403
407
bool isContextual = false );
404
408
405
409
/** Constructor for function which uses named parameter list and group list.
406
- * @note added in QGIS 3.0
410
+ * @note added in QGIS 2.18
407
411
*/
408
412
Function( const QString& fnname,
409
413
const QgsExpression::ParameterList& params,
@@ -419,6 +423,7 @@ class QgsExpression
419
423
420
424
/** The name of the function. */
421
425
QString name() const;
426
+
422
427
/** The number of parameters this function takes. */
423
428
int params() const;
424
429
@@ -431,6 +436,7 @@ class QgsExpression
431
436
const QgsExpression::ParameterList& parameters() const;
432
437
433
438
/** Does this function use a geometry object. */
439
+ //TODO QGIS 3.0 - rename to usesGeometry()
434
440
bool usesgeometry() const;
435
441
436
442
/** Returns a list of possible aliases for the function. These include
@@ -455,7 +461,7 @@ class QgsExpression
455
461
456
462
/** Returns true if the function is deprecated and should not be presented as a valid option
457
463
* to users in expression builders.
458
- * @note added in QGIS 3.0
464
+ * @note added in QGIS 2.18
459
465
*/
460
466
virtual bool isDeprecated() const;
461
467
@@ -465,12 +471,13 @@ class QgsExpression
465
471
QString group() const;
466
472
467
473
/** Returns a list of the groups the function belongs to.
468
- * @note added in QGIS 3.0
474
+ * @note added in QGIS 2.18
469
475
* @see group()
470
476
*/
471
477
QStringList groups() const;
472
478
473
479
/** The help text for the function. */
480
+ //TODO QGIS 3.0 - rename to helpText()
474
481
const QString helptext() const;
475
482
476
483
//! @deprecated Use QgsExpressionContext variant instead
@@ -684,6 +691,7 @@ class QgsExpression
684
691
685
692
//! Named node
686
693
//! @note added in QGIS 2.16
694
+ //! \ingroup core
687
695
class NamedNode
688
696
{
689
697
public:
@@ -737,7 +745,7 @@ class QgsExpression
737
745
//TODO QGIS 3.0 - remove
738
746
//! @deprecated use QgsInterval instead
739
747
class Interval
740
- {
748
+ {
741
749
public:
742
750
Interval( int seconds = 0 );
743
751
@@ -785,6 +793,8 @@ class QgsExpression
785
793
virtual QgsExpression::Node* clone() const;
786
794
};
787
795
796
+ /** \ingroup core
797
+ */
788
798
class NodeBinaryOperator : QgsExpression::Node
789
799
{
790
800
public:
@@ -820,6 +830,8 @@ class QgsExpression
820
830
QDateTime computeDateTimeFromInterval( const QDateTime& d, QgsInterval *i );
821
831
};
822
832
833
+ /** \ingroup core
834
+ */
823
835
class NodeInOperator : QgsExpression::Node
824
836
{
825
837
public:
@@ -841,6 +853,8 @@ class QgsExpression
841
853
virtual QgsExpression::Node* clone() const;
842
854
};
843
855
856
+ /** \ingroup core
857
+ */
844
858
class NodeFunction : QgsExpression::Node
845
859
{
846
860
public:
@@ -865,6 +879,8 @@ class QgsExpression
865
879
static bool validateParams( int fnIndex, QgsExpression::NodeList* args, QString& error );
866
880
};
867
881
882
+ /** \ingroup core
883
+ */
868
884
class NodeLiteral : QgsExpression::Node
869
885
{
870
886
public:
@@ -884,6 +900,8 @@ class QgsExpression
884
900
virtual void accept( QgsExpression::Visitor& v ) const;
885
901
};
886
902
903
+ /** \ingroup core
904
+ */
887
905
class NodeColumnRef : QgsExpression::Node
888
906
{
889
907
public:
@@ -904,6 +922,8 @@ class QgsExpression
904
922
virtual QgsExpression::Node* clone() const;
905
923
};
906
924
925
+ /** \ingroup core
926
+ */
907
927
class WhenThen
908
928
{
909
929
public:
@@ -919,6 +939,8 @@ class QgsExpression
919
939
920
940
};
921
941
942
+ /** \ingroup core
943
+ */
922
944
class NodeCondition : QgsExpression::Node
923
945
{
924
946
public:
@@ -938,8 +960,10 @@ class QgsExpression
938
960
939
961
//////
940
962
941
- /** Support for visitor pattern - algorithms dealing with the expressions
942
- may be implemented without modifying the Node classes */
963
+ /** \ingroup core
964
+ * Support for visitor pattern - algorithms dealing with the expressions
965
+ * may be implemented without modifying the Node classes
966
+ */
943
967
class Visitor
944
968
{
945
969
public:
0 commit comments