Skip to content

Commit 3e73840

Browse files
committedNov 26, 2016
* 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;

‎src/core/qgsexpression.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,8 @@ class CORE_EXPORT QgsExpression
511511
typedef QVariant( *FcnEvalContext )( const QVariantList& values, const QgsExpressionContext* context, QgsExpression* parent );
512512

513513
/** \ingroup core
514-
* A abstract base class for defining QgsExpression functions.
515-
*/
514+
* A abstract base class for defining QgsExpression functions.
515+
*/
516516
class CORE_EXPORT Function
517517
{
518518
public:
@@ -540,7 +540,7 @@ class CORE_EXPORT QgsExpression
540540
}
541541

542542
/** Constructor for function which uses unnamed parameters and group list
543-
* @note added in QGIS 3.0
543+
* @note added in QGIS 2.18
544544
*/
545545
Function( const QString& fnname,
546546
int params,
@@ -588,7 +588,7 @@ class CORE_EXPORT QgsExpression
588588
{}
589589

590590
/** Constructor for function which uses named parameter list and group list.
591-
* @note added in QGIS 3.0
591+
* @note added in QGIS 2.18
592592
*/
593593
Function( const QString& fnname,
594594
const ParameterList& params,
@@ -653,7 +653,8 @@ class CORE_EXPORT QgsExpression
653653

654654
/** True if this function should use lazy evaluation. Lazy evaluation functions take QgsExpression::Node objects
655655
* rather than the node results when called. You can use node->eval(parent, feature) to evaluate the node and return the result
656-
* Functions are non lazy default and will be given the node return value when called **/
656+
* Functions are non lazy default and will be given the node return value when called
657+
*/
657658
bool lazyEval() const { return mLazyEval; }
658659

659660
virtual QStringList referencedColumns() const { return mReferencedColumns; }
@@ -665,7 +666,7 @@ class CORE_EXPORT QgsExpression
665666

666667
/** Returns true if the function is deprecated and should not be presented as a valid option
667668
* to users in expression builders.
668-
* @note added in QGIS 3.0
669+
* @note added in QGIS 2.18
669670
*/
670671
virtual bool isDeprecated() const { return mGroups.isEmpty() ? false : mGroups.contains( "deprecated" ); }
671672

@@ -675,7 +676,7 @@ class CORE_EXPORT QgsExpression
675676
QString group() const { return mGroups.isEmpty() ? QString() : mGroups.at( 0 ); }
676677

677678
/** Returns a list of the groups the function belongs to.
678-
* @note added in QGIS 3.0
679+
* @note added in QGIS 2.18
679680
* @see group()
680681
*/
681682
QStringList groups() const { return mGroups; }
@@ -1441,7 +1442,8 @@ class CORE_EXPORT QgsExpression
14411442

14421443
/** \ingroup core
14431444
* Support for visitor pattern - algorithms dealing with the expressions
1444-
may be implemented without modifying the Node classes */
1445+
* may be implemented without modifying the Node classes
1446+
*/
14451447
class CORE_EXPORT Visitor
14461448
{
14471449
public:

‎src/core/qgsvectorfilewriter.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class CORE_EXPORT QgsVectorFileWriter
200200
};
201201

202202
/** Edition capability flags
203-
* @note Added in QGIS 3.0 */
203+
* @note Added in QGIS 2.18 */
204204
enum EditionCapability
205205
{
206206
/** Flag to indicate that a new layer can be added to the dataset */
@@ -217,11 +217,11 @@ class CORE_EXPORT QgsVectorFileWriter
217217
};
218218

219219
/** Combination of CanAddNewLayer, CanAppendToExistingLayer, CanAddNewFieldsToExistingLayer or CanDeleteLayer
220-
* @note Added in QGIS 3.0 */
220+
* @note Added in QGIS 2.18 */
221221
Q_DECLARE_FLAGS( EditionCapabilities, EditionCapability )
222222

223223
/** Enumeration to describe how to handle existing files
224-
@note Added in QGIS 3.0
224+
@note Added in QGIS 2.18
225225
*/
226226
typedef enum
227227
{
@@ -328,7 +328,7 @@ class CORE_EXPORT QgsVectorFileWriter
328328

329329
/** \ingroup core
330330
* Options to pass to writeAsVectorFormat()
331-
* @note Added in QGIS 3.0
331+
* @note Added in QGIS 2.18
332332
*/
333333
class CORE_EXPORT SaveVectorOptions
334334
{
@@ -490,20 +490,20 @@ class CORE_EXPORT QgsVectorFileWriter
490490

491491
/**
492492
* Return edition capabilites for an existing dataset name.
493-
* @note added in QGIS 3.0
493+
* @note added in QGIS 2.18
494494
*/
495495
static EditionCapabilities editionCapabilities( const QString& datasetName );
496496

497497
/**
498498
* Returns whether the target layer already exists.
499-
* @note added in QGIS 3.0
499+
* @note added in QGIS 2.18
500500
*/
501501
static bool targetLayerExists( const QString& datasetName,
502502
const QString& layerName );
503503

504504
/**
505505
* Returns whether there are among the attributes specified some that do not exist yet in the layer
506-
* @note added in QGIS 3.0
506+
* @note added in QGIS 2.18
507507
*/
508508
static bool areThereNewFieldsToCreate( const QString& datasetName,
509509
const QString& layerName,

‎src/core/qgsvectorlayercache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class CORE_EXPORT QgsVectorLayerCache : public QObject
139139
* a result of a call to setFullCache() or by through a feature request which resulted in
140140
* all available features being cached.
141141
* @see setFullCache()
142-
* @note added in QGIS 3.0
142+
* @note added in QGIS 2.18
143143
*/
144144
bool hasFullCache() const { return mFullCache; }
145145

@@ -173,7 +173,7 @@ class CORE_EXPORT QgsVectorLayerCache : public QObject
173173
bool isFidCached( const QgsFeatureId fid ) const;
174174

175175
/** Returns the set of feature IDs for features which are cached.
176-
* @note added in QGIS 3.0
176+
* @note added in QGIS 2.18
177177
* @see isFidCached()
178178
*/
179179
QgsFeatureIds cachedFeatureIds() const { return mCache.keys().toSet(); }

‎src/gui/qgisgui.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ namespace QgisGui
5252
/**
5353
* Minimum magnification level allowed in map canvases.
5454
* @see CANVAS_MAGNIFICATION_MAX
55-
* @note added in QGIS 3.0
55+
* @note added in QGIS 2.18
5656
*/
57-
constexpr double CANVAS_MAGNIFICATION_MIN = 0.1;
57+
static const double CANVAS_MAGNIFICATION_MIN = 0.1;
5858

5959
/**
6060
* Maximum magnification level allowed in map canvases.
6161
* @see CANVAS_MAGNIFICATION_MAX
62-
* @note added in QGIS 3.0
62+
* @note added in QGIS 2.18
6363
*/
6464
// Must be a factor of 2, so zooming in to max from 100% then zooming back out will result in 100% mag
65-
constexpr double CANVAS_MAGNIFICATION_MAX = 16.0;
65+
static const double CANVAS_MAGNIFICATION_MAX = 16.0;
6666

6767
/**
6868
Open files, preferring to have the default file selector be the

0 commit comments

Comments
 (0)
Please sign in to comment.