Skip to content

Commit 3e73840

Browse files
committed
* replace constexpr (fixes pre-c++11 windows build)
* fix "added in 3.0" annotation * sip syncs
1 parent 0cfd7d8 commit 3e73840

File tree

8 files changed

+93
-46
lines changed

8 files changed

+93
-46
lines changed

python/core/qgsexpression.sip

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class QgsExpression
88
/**
99
* Creates a new expression based on the provided string.
1010
* 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
1212
* loop in which this expression is used.
1313
*/
1414
QgsExpression( const QString& expr );
@@ -49,7 +49,8 @@ class QgsExpression
4949

5050
/**
5151
* 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
5354
* all attributes from the layer are required for evaluation of the expression.
5455
* QgsFeatureRequest::setSubsetOfAttributes automatically handles this case.
5556
*
@@ -146,17 +147,17 @@ class QgsExpression
146147
*/
147148
static bool isValid( const QString& text, const QgsExpressionContext* context, QString &errorMessage );
148149

149-
void setScale( double scale );
150-
151-
double scale();
152-
153150
/**
154151
* Set the expression string, will reset the whole internal structure.
155152
*
156153
* @note Added in QGIS 2.18
157154
*/
158155
void setExpression( const QString& expression );
159156

157+
void setScale( double scale );
158+
159+
double scale();
160+
160161
//! Return the original, unmodified expression string.
161162
//! If there was none supplied because it was constructed by sole
162163
//! API calls, dump() will be used to create one instead.
@@ -172,6 +173,7 @@ class QgsExpression
172173
* (used by $length, $area and $perimeter functions only)
173174
* @see setGeomCalculator()
174175
* @see distanceUnits()
176+
* @see areaUnits()
175177
*/
176178
QgsDistanceArea *geomCalculator();
177179

@@ -188,13 +190,15 @@ class QgsExpression
188190
* @note distances are only converted when a geomCalculator() has been set
189191
* @note added in QGIS 2.14
190192
* @see setDistanceUnits()
193+
* @see areaUnits()
191194
*/
192195
QGis::UnitType distanceUnits() const;
193196

194197
/** Sets the desired distance units for calculations involving geomCalculator(), eg "$length" and "$perimeter".
195198
* @note distances are only converted when a geomCalculator() has been set
196199
* @note added in QGIS 2.14
197200
* @see distanceUnits()
201+
* @see setAreaUnits()
198202
*/
199203
void setDistanceUnits( QGis::UnitType unit );
200204

@@ -358,7 +362,7 @@ class QgsExpression
358362
//! List of parameters, used for function definition
359363
typedef QList< QgsExpression::Parameter > ParameterList;
360364

361-
/**
365+
/** \ingroup core
362366
* A abstract base class for defining QgsExpression functions.
363367
*/
364368
class Function
@@ -377,7 +381,7 @@ class QgsExpression
377381
bool isContextual = false );
378382

379383
/** Constructor for function which uses unnamed parameters and group list
380-
* @note added in QGIS 3.0
384+
* @note added in QGIS 2.18
381385
*/
382386
Function( const QString& fnname,
383387
int params,
@@ -403,7 +407,7 @@ class QgsExpression
403407
bool isContextual = false );
404408

405409
/** 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
407411
*/
408412
Function( const QString& fnname,
409413
const QgsExpression::ParameterList& params,
@@ -419,6 +423,7 @@ class QgsExpression
419423

420424
/** The name of the function. */
421425
QString name() const;
426+
422427
/** The number of parameters this function takes. */
423428
int params() const;
424429

@@ -431,6 +436,7 @@ class QgsExpression
431436
const QgsExpression::ParameterList& parameters() const;
432437

433438
/** Does this function use a geometry object. */
439+
//TODO QGIS 3.0 - rename to usesGeometry()
434440
bool usesgeometry() const;
435441

436442
/** Returns a list of possible aliases for the function. These include
@@ -455,7 +461,7 @@ class QgsExpression
455461

456462
/** Returns true if the function is deprecated and should not be presented as a valid option
457463
* to users in expression builders.
458-
* @note added in QGIS 3.0
464+
* @note added in QGIS 2.18
459465
*/
460466
virtual bool isDeprecated() const;
461467

@@ -465,12 +471,13 @@ class QgsExpression
465471
QString group() const;
466472

467473
/** Returns a list of the groups the function belongs to.
468-
* @note added in QGIS 3.0
474+
* @note added in QGIS 2.18
469475
* @see group()
470476
*/
471477
QStringList groups() const;
472478

473479
/** The help text for the function. */
480+
//TODO QGIS 3.0 - rename to helpText()
474481
const QString helptext() const;
475482

476483
//! @deprecated Use QgsExpressionContext variant instead
@@ -684,6 +691,7 @@ class QgsExpression
684691

685692
//! Named node
686693
//! @note added in QGIS 2.16
694+
//! \ingroup core
687695
class NamedNode
688696
{
689697
public:
@@ -737,7 +745,7 @@ class QgsExpression
737745
//TODO QGIS 3.0 - remove
738746
//! @deprecated use QgsInterval instead
739747
class Interval
740-
{
748+
{
741749
public:
742750
Interval( int seconds = 0 );
743751

@@ -785,6 +793,8 @@ class QgsExpression
785793
virtual QgsExpression::Node* clone() const;
786794
};
787795

796+
/** \ingroup core
797+
*/
788798
class NodeBinaryOperator : QgsExpression::Node
789799
{
790800
public:
@@ -820,6 +830,8 @@ class QgsExpression
820830
QDateTime computeDateTimeFromInterval( const QDateTime& d, QgsInterval *i );
821831
};
822832

833+
/** \ingroup core
834+
*/
823835
class NodeInOperator : QgsExpression::Node
824836
{
825837
public:
@@ -841,6 +853,8 @@ class QgsExpression
841853
virtual QgsExpression::Node* clone() const;
842854
};
843855

856+
/** \ingroup core
857+
*/
844858
class NodeFunction : QgsExpression::Node
845859
{
846860
public:
@@ -865,6 +879,8 @@ class QgsExpression
865879
static bool validateParams( int fnIndex, QgsExpression::NodeList* args, QString& error );
866880
};
867881

882+
/** \ingroup core
883+
*/
868884
class NodeLiteral : QgsExpression::Node
869885
{
870886
public:
@@ -884,6 +900,8 @@ class QgsExpression
884900
virtual void accept( QgsExpression::Visitor& v ) const;
885901
};
886902

903+
/** \ingroup core
904+
*/
887905
class NodeColumnRef : QgsExpression::Node
888906
{
889907
public:
@@ -904,6 +922,8 @@ class QgsExpression
904922
virtual QgsExpression::Node* clone() const;
905923
};
906924

925+
/** \ingroup core
926+
*/
907927
class WhenThen
908928
{
909929
public:
@@ -919,6 +939,8 @@ class QgsExpression
919939

920940
};
921941

942+
/** \ingroup core
943+
*/
922944
class NodeCondition : QgsExpression::Node
923945
{
924946
public:
@@ -938,8 +960,10 @@ class QgsExpression
938960

939961
//////
940962

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+
*/
943967
class Visitor
944968
{
945969
public:

python/core/qgsexpressionfieldbuffer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class QgsExpressionFieldBuffer
3333
* @param index The index of the expression to change
3434
* @param name New name for field
3535
*
36-
* @note added in 3.0
36+
* @note added in 2.18
3737
*/
3838
void renameExpression( int index, const QString& name );
3939

python/core/qgsvectorfilewriter.sip

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class QgsVectorFileWriter
2020
Hidden
2121
};
2222

23+
/** \ingroup core
24+
*/
2325
class Option
2426
{
2527
public:
@@ -30,6 +32,8 @@ class QgsVectorFileWriter
3032
QgsVectorFileWriter::OptionType type;
3133
};
3234

35+
/** \ingroup core
36+
*/
3337
class SetOption : QgsVectorFileWriter::Option
3438
{
3539
public:
@@ -40,6 +44,8 @@ class QgsVectorFileWriter
4044
bool allowNone;
4145
};
4246

47+
/** \ingroup core
48+
*/
4349
class StringOption: QgsVectorFileWriter::Option
4450
{
4551
public:
@@ -48,6 +54,8 @@ class QgsVectorFileWriter
4854
QString defaultValue;
4955
};
5056

57+
/** \ingroup core
58+
*/
5159
class IntOption: QgsVectorFileWriter::Option
5260
{
5361
public:
@@ -56,12 +64,16 @@ class QgsVectorFileWriter
5664
int defaultValue;
5765
};
5866

67+
/** \ingroup core
68+
*/
5969
class BoolOption : QgsVectorFileWriter::SetOption
6070
{
6171
public:
6272
BoolOption( const QString& docString, bool defaultValue );
6373
};
6474

75+
/** \ingroup core
76+
*/
6577
class HiddenOption : QgsVectorFileWriter::Option
6678
{
6779
public:
@@ -106,7 +118,8 @@ class QgsVectorFileWriter
106118
SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels)
107119
};
108120

109-
/** Interface to convert raw field values to their user-friendly value.
121+
/** \ingroup core
122+
* Interface to convert raw field values to their user-friendly value.
110123
* @note Added in QGIS 2.16
111124
*/
112125
class FieldValueConverter
@@ -133,7 +146,7 @@ class QgsVectorFileWriter
133146
};
134147

135148
/** Edition capability flags
136-
* @note Added in QGIS 3.0 */
149+
* @note Added in QGIS 2.18 */
137150
enum EditionCapability
138151
{
139152
/** Flag to indicate that a new layer can be added to the dataset */
@@ -152,7 +165,7 @@ class QgsVectorFileWriter
152165
typedef QFlags<QgsVectorFileWriter::EditionCapability> EditionCapabilities;
153166

154167
/** Enumeration to describe how to handle existing files
155-
@note Added in QGIS 3.0
168+
@note Added in QGIS 2.18
156169
*/
157170
enum ActionOnExistingFile
158171
{
@@ -259,7 +272,7 @@ class QgsVectorFileWriter
259272

260273
/**
261274
* Options to pass to writeAsVectorFormat()
262-
* @note Added in QGIS 3.0
275+
* @note Added in QGIS 2.18
263276
*/
264277
class SaveVectorOptions
265278
{
@@ -330,7 +343,7 @@ class QgsVectorFileWriter
330343
* @param options options.
331344
* @param newFilename QString pointer which will contain the new file name created (in case it is different to fileName).
332345
* @param errorMessage pointer to buffer fo error message
333-
* @note added in 3.0
346+
* @note added in 2.18
334347
*/
335348
static WriterError writeAsVectorFormat( QgsVectorLayer* layer,
336349
const QString& fileName,
@@ -411,22 +424,30 @@ class QgsVectorFileWriter
411424

412425
static bool driverMetadata( const QString& driverName, MetaData& driverMetadata );
413426

427+
/**
428+
* Get the ogr geometry type from an internal QGIS wkb type enum.
429+
*
430+
* Will drop M values and convert Z to 2.5D where required.
431+
* @note not available in python bindings
432+
*/
433+
// static OGRwkbGeometryType ogrTypeFromWkbType( QgsWKBTypes::Type type );
434+
414435
/**
415436
* Return edition capabilites for an existing dataset name.
416-
* @note added in QGIS 3.0
437+
* @note added in QGIS 2.18
417438
*/
418439
static EditionCapabilities editionCapabilities( const QString& datasetName );
419440

420441
/**
421442
* Returns whether the target layer already exists.
422-
* @note added in QGIS 3.0
443+
* @note added in QGIS 2.18
423444
*/
424445
static bool targetLayerExists( const QString& datasetName,
425446
const QString& layerName );
426447

427448
/**
428449
* Returns whether there are among the attributes specified some that do not exist yet in the layer
429-
* @note added in QGIS 3.0
450+
* @note added in QGIS 2.18
430451
*/
431452
static bool areThereNewFieldsToCreate( const QString& datasetName,
432453
const QString& layerName,

python/core/qgsvectorlayercache.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class QgsVectorLayerCache : QObject
7373
* a result of a call to setFullCache() or by through a feature request which resulted in
7474
* all available features being cached.
7575
* @see setFullCache()
76-
* @note added in QGIS 3.0
76+
* @note added in QGIS 2.18
7777
*/
7878
bool hasFullCache() const;
7979

@@ -107,7 +107,7 @@ class QgsVectorLayerCache : QObject
107107
bool isFidCached( const QgsFeatureId fid ) const;
108108

109109
/** Returns the set of feature IDs for features which are cached.
110-
* @note added in QGIS 3.0
110+
* @note added in QGIS 2.18
111111
* @see isFidCached()
112112
*/
113113
QgsFeatureIds cachedFeatureIds() const;

0 commit comments

Comments
 (0)