Skip to content

Commit 09407c1

Browse files
authoredFeb 8, 2019
Merge pull request #9128 from m-kuhn/todo-qgis-4
Move QGIS 3 todos to QGIS 4
2 parents 440f8d4 + 2fb3704 commit 09407c1

19 files changed

+186
-49
lines changed
 

‎python/core/auto_generated/geometry/qgsgeometry.sip.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,22 @@ In case of error -1 will be returned.
499499
.. versionadded:: 3.0
500500
%End
501501

502+
502503
QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex /Out/, int &beforeVertex /Out/, int &afterVertex /Out/, double &sqrDist /Out/ ) const;
504+
%Docstring
505+
Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
506+
and the indices of the vertices before and after the closest vertex.
507+
508+
:param point: point to search for
509+
:param beforeVertex: will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if
510+
not present.
511+
:param afterVertex: will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if
512+
not present.
513+
:param sqrDist: will be set to the square distance between the closest vertex and the specified point
514+
515+
:return: - closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative.
516+
- atVertex: will be set to the vertex index of the closest found vertex
517+
%End
503518

504519
double distanceToVertex( int vertex ) const;
505520
%Docstring

‎python/core/auto_generated/qgscoordinatereferencesystem.sip.in

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ Constructs an invalid CRS object
175175

176176
~QgsCoordinateReferenceSystem();
177177

178+
178179
explicit QgsCoordinateReferenceSystem( const QString &definition );
179180
%Docstring
180181
Constructs a CRS object from a string definition using createFromString()
@@ -191,9 +192,9 @@ If no prefix is specified, WKT definition is assumed.
191192
:param definition: A String containing a coordinate reference system definition.
192193

193194
.. seealso:: :py:func:`createFromString`
194-
/ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
195195
%End
196196

197+
197198
explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId );
198199
%Docstring
199200
Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS CRS ID.
@@ -205,7 +206,6 @@ Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS
205206

206207
:param id: The ID valid for the chosen CRS ID type
207208
:param type: One of the types described in CrsType
208-
/ // TODO QGIS 3: remove type and always use EPSG code
209209
%End
210210

211211
QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem &srs );
@@ -294,6 +294,7 @@ Creates a CRS from a specified QGIS SRS ID.
294294
%End
295295

296296

297+
297298
bool createFromId( long id, CrsType type = PostgisCrsId );
298299
%Docstring
299300
Sets this CRS by lookup of the given ID in the CRS database.
@@ -304,9 +305,9 @@ Sets this CRS by lookup of the given ID in the CRS database.
304305

305306
We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
306307
wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
307-
/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
308308
%End
309309

310+
310311
bool createFromOgcWmsCrs( const QString &crs );
311312
%Docstring
312313
Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
@@ -322,17 +323,16 @@ and refer to QGIS internal CRS IDs.
322323
this method uses an internal cache. Call invalidateCache() to clear the cache.
323324

324325
.. seealso:: :py:func:`fromOgcWmsCrs`
325-
/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
326326
%End
327327

328+
328329
bool createFromSrid( long srid );
329330
%Docstring
330331
Sets this CRS by lookup of the given PostGIS SRID in the CRS database.
331332

332333
:param srid: The PostGIS SRID for the desired spatial reference system.
333334

334335
:return: True on success else false
335-
/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
336336
%End
337337

338338
bool createFromWkt( const QString &wkt );
@@ -489,6 +489,7 @@ if that involves resorting to a hard coded default of geocs:wgs84.
489489
.. seealso:: :py:func:`setCustomCrsValidation`
490490
%End
491491

492+
492493
long findMatchingProj();
493494
%Docstring
494495
Walks the CRS databases (both system and user database) trying to match
@@ -500,7 +501,6 @@ pieces of information about CRS.
500501
The ellipsoid and projection acronyms must be set as well as the proj4string!
501502

502503
:return: long the SrsId of the matched CRS, zero if no match was found
503-
/ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
504504
%End
505505

506506
bool operator==( const QgsCoordinateReferenceSystem &srs ) const;
@@ -538,12 +538,12 @@ Returns the internal CRS ID, if available.
538538
:return: the internal sqlite3 srs.db primary key for this CRS
539539
%End
540540

541+
541542
long postgisSrid() const;
542543
%Docstring
543544
Returns PostGIS SRID for the CRS.
544545

545546
:return: the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0)
546-
/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
547547
%End
548548

549549
QString authid() const;

‎python/core/auto_generated/qgspallabeling.sip.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class QgsPalLayerSettings
5454
~QgsPalLayerSettings();
5555

5656

57+
5758
enum Placement
5859
{
5960
AroundPoint,
@@ -82,12 +83,14 @@ class QgsPalLayerSettings
8283
BottomRight,
8384
};
8485

86+
8587
enum OffsetType
8688
{
8789
FromPoint,
8890
FromSymbolBounds,
8991
};
9092

93+
9194
enum LinePlacementFlags
9295
{
9396
OnLine,
@@ -131,6 +134,7 @@ class QgsPalLayerSettings
131134
MultiFollowPlacement
132135
};
133136

137+
134138
enum ObstacleType
135139
{
136140
PolygonInterior,

‎python/core/auto_generated/qgsproject.sip.in

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,24 @@ of any layers these layers will also be deleted.
844844
.. versionadded:: 1.8
845845
%End
846846

847+
847848
void removeMapLayers( const QList<QgsMapLayer *> &layers );
849+
%Docstring
850+
Remove a set of layers from the registry.
851+
852+
The specified layers will be removed from the registry. If the registry has ownership
853+
of any layers these layers will also be deleted.
854+
855+
:param layers: A list of layers to remove. Null pointers are ignored.
856+
857+
.. note::
858+
859+
As a side-effect the QgsProject instance is marked dirty.
860+
861+
.. seealso:: :py:func:`removeMapLayer`
862+
863+
.. seealso:: :py:func:`removeAllMapLayers`
864+
%End
848865

849866
void removeMapLayer( const QString &layerId );
850867
%Docstring
@@ -1323,7 +1340,14 @@ Emitted after a layer was removed from the registry.
13231340
.. seealso:: :py:func:`layerWillBeRemoved`
13241341
%End
13251342

1343+
13261344
void removeAll();
1345+
%Docstring
1346+
Emitted when all layers are removed, before layersWillBeRemoved() and
1347+
layerWillBeRemoved() signals are emitted. The layersWillBeRemoved() and
1348+
layerWillBeRemoved() signals will still be emitted following this signal.
1349+
You can use this signal to do easy (and fast) cleanup.
1350+
%End
13271351

13281352
void layersAdded( const QList<QgsMapLayer *> &layers );
13291353
%Docstring

‎python/core/auto_generated/qgsvectorlayertools.sip.in

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ in your application.
2727
public:
2828
QgsVectorLayerTools();
2929

30+
3031
virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature /Out/ = 0 ) const = 0;
3132
%Docstring
3233
This method should/will be called, whenever a new feature will be added to the layer
@@ -37,10 +38,9 @@ This method should/will be called, whenever a new feature will be added to the l
3738

3839
:return: - True in case of success, False if the operation failed/was aborted
3940
- feature: Updated feature after adding will be written back to this
40-
41-
TODO QGIS 3: remove const qualifier
4241
%End
4342

43+
4444
virtual bool startEditing( QgsVectorLayer *layer ) const = 0;
4545
%Docstring
4646
This will be called, whenever a vector layer should be switched to edit mode. Check the providers
@@ -50,10 +50,9 @@ If successful layer->startEditing() will be called and true returned.
5050
:param layer: The layer on which to start an edit session
5151

5252
:return: True, if the editing session was started
53-
54-
TODO QGIS 3: remove const qualifier
5553
%End
5654

55+
5756
virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0;
5857
%Docstring
5958
Will be called, when an editing session is ended and the features should be committed.
@@ -63,21 +62,19 @@ Appropriate dialogs should be shown like
6362
:param allowCancel: True if a cancel button should be offered
6463

6564
:return: True if successful
66-
67-
TODO QGIS 3: remove const qualifier
6865
%End
6966

67+
7068
virtual bool saveEdits( QgsVectorLayer *layer ) const = 0;
7169
%Docstring
7270
Should be called, when the features should be committed but the editing session is not ended.
7371

7472
:param layer: The layer to commit
7573

7674
:return: True if successful
77-
78-
TODO QGIS 3: remove const qualifier
7975
%End
8076

77+
8178
virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request /In,Out/, double dx = 0, double dy = 0, QString *errorMsg /Out/ = 0 ) const;
8279
%Docstring
8380
Copy and move features with defined translation.
@@ -89,8 +86,6 @@ Copy and move features with defined translation.
8986

9087
:return: - True if all features could be copied.
9188
- errorMsg: If given, it will contain the error message
92-
93-
TODO QGIS 3: remove const qualifier
9489
%End
9590

9691
};

‎python/gui/auto_generated/attributetable/qgsattributetablemodel.sip.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,11 @@ to dynamically adjust it.
215215
:param request: The request to use to fill this table model.
216216
%End
217217

218+
218219
const QgsFeatureRequest &request() const;
220+
%Docstring
221+
Gets the the feature request
222+
%End
219223

220224
void setEditorContext( const QgsAttributeEditorContext &context );
221225
%Docstring

‎python/gui/auto_generated/qgsattributeform.sip.in

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,32 @@ class QgsAttributeForm : QWidget
4444

4545
const QgsFeature &feature();
4646

47+
4748
void hideButtonBox();
49+
%Docstring
50+
Hides the button box (OK/Cancel) and enables auto-commit
51+
52+
.. note::
53+
54+
set Embed in QgsAttributeEditorContext in constructor instead
55+
%End
56+
4857

4958
void showButtonBox();
59+
%Docstring
60+
Shows the button box (OK/Cancel) and disables auto-commit
61+
62+
.. note::
63+
64+
set Embed in QgsAttributeEditorContext in constructor instead
65+
%End
66+
5067

5168
void disconnectButtonBox();
69+
%Docstring
70+
Disconnects the button box (OK/Cancel) from the accept/resetValues slots
71+
If this method is called, you have to create these connections from outside
72+
%End
5273

5374
void addInterface( QgsAttributeFormInterface *iface /Transfer/ );
5475
%Docstring

‎python/gui/auto_generated/qgsmaptoolcapture.sip.in

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,45 @@ convenient method to clean members
9696

9797
protected:
9898

99+
99100
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
101+
%Docstring
102+
Converts a map point to layer coordinates
103+
104+
:param mapPoint: the point in map coordinates
105+
\param[in,out] layerPoint the point in layer coordinates
106+
107+
:return:
108+
0 in case of success
109+
1 if the current layer is null or not a vector layer
110+
2 if the transformation failed
111+
%End
112+
100113

101114
int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
115+
%Docstring
116+
Converts a point to map coordinates and layer coordinates
117+
118+
:param p: the input point
119+
\param[in,out] layerPoint the point in layer coordinates
120+
\param[in,out] mapPoint the point in map coordinates
121+
122+
:return:
123+
0 in case of success
124+
1 if the current layer is null or not a vector layer
125+
2 if the transformation failed
126+
%End
127+
102128

103129
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
130+
%Docstring
131+
Fetches the original point from the source layer if it has the same
132+
CRS as the current layer.
133+
134+
:return: 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure
135+
136+
.. versionadded:: 2.14
137+
%End
104138

105139
QgsPoint mapPoint( const QgsMapMouseEvent &e ) const;
106140
%Docstring
@@ -129,7 +163,13 @@ WkbType of the current layer).
129163
.. versionadded:: 3.0
130164
%End
131165

166+
132167
int addVertex( const QgsPointXY &point );
168+
%Docstring
169+
Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)
170+
171+
:return: 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed
172+
%End
133173

134174
int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match );
135175
%Docstring

‎src/core/geometry/qgsgeometry.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,8 @@ class CORE_EXPORT QgsGeometry
576576
*/
577577
double hausdorffDistanceDensify( const QgsGeometry &geom, double densifyFraction ) const;
578578

579+
//TODO QGIS 4.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
580+
579581
/**
580582
* Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
581583
* and the indices of the vertices before and after the closest vertex.
@@ -588,7 +590,6 @@ class CORE_EXPORT QgsGeometry
588590
* \param sqrDist will be set to the square distance between the closest vertex and the specified point
589591
* \returns closest point in geometry. If not found (empty geometry), returns null point nad sqrDist is negative.
590592
*/
591-
//TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
592593
QgsPointXY closestVertex( const QgsPointXY &point, int &atVertex SIP_OUT, int &beforeVertex SIP_OUT, int &afterVertex SIP_OUT, double &sqrDist SIP_OUT ) const;
593594

594595
/**

‎src/core/qgscoordinatereferencesystem.h

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
210210

211211
~QgsCoordinateReferenceSystem();
212212

213+
// TODO QGIS 4: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
214+
213215
/**
214216
* Constructs a CRS object from a string definition using createFromString()
215217
*
@@ -223,16 +225,18 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
223225
* If no prefix is specified, WKT definition is assumed.
224226
* \param definition A String containing a coordinate reference system definition.
225227
* \see createFromString()
226-
*/ // TODO QGIS 3: remove "POSTGIS" and "INTERNAL", allow PROJ4 without the prefix
228+
*/
227229
explicit QgsCoordinateReferenceSystem( const QString &definition );
228230

231+
// TODO QGIS 4: remove type and always use EPSG code
232+
229233
/**
230234
* Constructor a CRS object using a PostGIS SRID, an EPSG code or an internal QGIS CRS ID.
231235
* \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
232236
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
233237
* \param id The ID valid for the chosen CRS ID type
234238
* \param type One of the types described in CrsType
235-
*/ // TODO QGIS 3: remove type and always use EPSG code
239+
*/
236240
explicit QgsCoordinateReferenceSystem( long id, CrsType type = PostgisCrsId );
237241

238242
//! Copy constructor
@@ -305,14 +309,18 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
305309

306310
// Misc helper functions -----------------------
307311

312+
// TODO QGIS 4: remove type and always use EPSG code, rename to createFromEpsg
313+
308314
/**
309315
* Sets this CRS by lookup of the given ID in the CRS database.
310316
* \returns True on success else false
311317
* \note We encourage you to use EPSG code, WKT or Proj4 to describe CRS's in your code
312318
* wherever possible. Internal QGIS CRS IDs are not guaranteed to be permanent / involatile.
313-
*/ // TODO QGIS 3: remove type and always use EPSG code, rename to createFromEpsg
319+
*/
314320
bool createFromId( long id, CrsType type = PostgisCrsId );
315321

322+
// TODO QGIS 4: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
323+
316324
/**
317325
* Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
318326
*
@@ -322,14 +330,16 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
322330
* \returns True on success else false
323331
* \note this method uses an internal cache. Call invalidateCache() to clear the cache.
324332
* \see fromOgcWmsCrs()
325-
*/ // TODO QGIS 3: remove "QGIS" and "CUSTOM", only support "USER" (also returned by authid())
333+
*/
326334
bool createFromOgcWmsCrs( const QString &crs );
327335

336+
// TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead
337+
328338
/**
329339
* Sets this CRS by lookup of the given PostGIS SRID in the CRS database.
330340
* \param srid The PostGIS SRID for the desired spatial reference system.
331341
* \returns True on success else false
332-
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
342+
*/
333343
bool createFromSrid( long srid );
334344

335345
/**
@@ -444,13 +454,15 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
444454
*/
445455
void validate();
446456

457+
// TODO QGIS 4: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
458+
447459
/**
448460
* Walks the CRS databases (both system and user database) trying to match
449461
* stored PROJ string to a database entry in order to fill in further
450462
* pieces of information about CRS.
451463
* \note The ellipsoid and projection acronyms must be set as well as the proj4string!
452464
* \returns long the SrsId of the matched CRS, zero if no match was found
453-
*/ // TODO QGIS 3: seems completely obsolete now (only compares proj4 - already done in createFromProj4)
465+
*/
454466
long findMatchingProj();
455467

456468
/**
@@ -504,10 +516,12 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
504516
*/
505517
long srsid() const;
506518

519+
// TODO QGIS 4: remove unless really necessary - let's use EPSG codes instead
520+
507521
/**
508522
* Returns PostGIS SRID for the CRS.
509523
* \returns the PostGIS spatial_ref_sys identifier for this CRS (defaults to 0)
510-
*/ // TODO QGIS 3: remove unless really necessary - let's use EPSG codes instead
524+
*/
511525
long postgisSrid() const;
512526

513527
/**

‎src/core/qgspallabeling.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ class CORE_EXPORT QgsPalLayerSettings
129129
//! copy operator - only copies the permanent members
130130
QgsPalLayerSettings &operator=( const QgsPalLayerSettings &s );
131131

132+
//TODO QGIS 4.0 - move to QgsLabelingEngine
133+
132134
/**
133135
* Placement modes which determine how label candidates are generated for a feature.
134136
*/
135-
//TODO QGIS 3.0 - move to QgsLabelingEngine
136137
enum Placement
137138
{
138139
AroundPoint, //!< Arranges candidates in a circle around a point (or centroid of a polygon). Applies to point or polygon layers only.
@@ -145,8 +146,8 @@ class CORE_EXPORT QgsPalLayerSettings
145146
PerimeterCurved, //! Arranges candidates following the curvature of a polygon's boundary. Applies to polygon layers only.
146147
};
147148

149+
//TODO QGIS 4.0 - move to QgsLabelingEngine
148150
//! Positions for labels when using the QgsPalLabeling::OrderedPositionsAroundPoint placement mode
149-
//TODO QGIS 3.0 - move to QgsLabelingEngine
150151
enum PredefinedPointPosition
151152
{
152153
TopLeft, //!< Label on top-left of point
@@ -163,22 +164,24 @@ class CORE_EXPORT QgsPalLayerSettings
163164
BottomRight, //!< Label on bottom right of point
164165
};
165166

167+
//TODO QGIS 4.0 - move to QgsLabelingEngine
168+
166169
/**
167170
* Behavior modifier for label offset and distance, only applies in some
168171
* label placement modes.
169172
*/
170-
//TODO QGIS 3.0 - move to QgsLabelingEngine
171173
enum OffsetType
172174
{
173175
FromPoint, //!< Offset distance applies from point geometry
174176
FromSymbolBounds, //!< Offset distance applies from rendered symbol bounds
175177
};
176178

179+
//TODO QGIS 4.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make
180+
//LinePlacementFlags type, and replace use of pal::LineArrangementFlag
181+
177182
/**
178183
* Line placement flags, which control how candidates are generated for a linear feature.
179184
*/
180-
//TODO QGIS 3.0 - move to QgsLabelingEngine, rename to LinePlacementFlag, use Q_DECLARE_FLAGS to make
181-
//LinePlacementFlags type, and replace use of pal::LineArrangementFlag
182185
enum LinePlacementFlags
183186
{
184187
OnLine = 1, //!< Labels can be placed directly over a line feature.
@@ -229,11 +232,12 @@ class CORE_EXPORT QgsPalLayerSettings
229232
will be drawn with right alignment*/
230233
};
231234

235+
//TODO QGIS 4.0 - Move to QgsLabelingEngine
236+
232237
/**
233238
* Valid obstacle types, which affect how features within the layer will act as obstacles
234239
* for labels.
235240
*/
236-
//TODO QGIS 3.0 - Move to QgsLabelingEngine
237241
enum ObstacleType
238242
{
239243
PolygonInterior, /*!< avoid placing labels over interior of polygon (prefer placing labels totally

‎src/core/qgsproject.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,8 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
846846
*/
847847
void removeMapLayers( const QStringList &layerIds );
848848

849+
//TODO QGIS 4.0 - add PyName alias to avoid list type conversion error
850+
849851
/**
850852
* \brief
851853
* Remove a set of layers from the registry.
@@ -859,7 +861,6 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
859861
* \see removeMapLayer()
860862
* \see removeAllMapLayers()
861863
*/
862-
//TODO QGIS 3.0 - add PyName alias to avoid list type conversion error
863864
void removeMapLayers( const QList<QgsMapLayer *> &layers );
864865

865866
/**
@@ -1279,13 +1280,14 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
12791280
*/
12801281
void layerRemoved( const QString &layerId );
12811282

1283+
//TODO QGIS 4.0 - rename to past tense
1284+
12821285
/**
12831286
* Emitted when all layers are removed, before layersWillBeRemoved() and
12841287
* layerWillBeRemoved() signals are emitted. The layersWillBeRemoved() and
12851288
* layerWillBeRemoved() signals will still be emitted following this signal.
12861289
* You can use this signal to do easy (and fast) cleanup.
12871290
*/
1288-
//TODO QGIS 3.0 - rename to past tense
12891291
void removeAll();
12901292

12911293
/**

‎src/core/qgsvectorlayertools.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject
4343
public:
4444
QgsVectorLayerTools();
4545

46+
// TODO QGIS 4: remove const qualifier
47+
4648
/**
4749
* This method should/will be called, whenever a new feature will be added to the layer
4850
*
@@ -52,10 +54,11 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject
5254
* \param feature Updated feature after adding will be written back to this
5355
* \returns True in case of success, False if the operation failed/was aborted
5456
*
55-
* TODO QGIS 3: remove const qualifier
5657
*/
5758
virtual bool addFeature( QgsVectorLayer *layer, const QgsAttributeMap &defaultValues = QgsAttributeMap(), const QgsGeometry &defaultGeometry = QgsGeometry(), QgsFeature *feature SIP_OUT = nullptr ) const = 0;
5859

60+
// TODO QGIS 4: remove const qualifier
61+
5962
/**
6063
* This will be called, whenever a vector layer should be switched to edit mode. Check the providers
6164
* capability to edit in here.
@@ -65,10 +68,11 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject
6568
*
6669
* \returns True, if the editing session was started
6770
*
68-
* TODO QGIS 3: remove const qualifier
6971
*/
7072
virtual bool startEditing( QgsVectorLayer *layer ) const = 0;
7173

74+
// TODO QGIS 4: remove const qualifier
75+
7276
/**
7377
* Will be called, when an editing session is ended and the features should be committed.
7478
* Appropriate dialogs should be shown like
@@ -77,20 +81,22 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject
7781
* \param allowCancel True if a cancel button should be offered
7882
* \returns True if successful
7983
*
80-
* TODO QGIS 3: remove const qualifier
8184
*/
8285
virtual bool stopEditing( QgsVectorLayer *layer, bool allowCancel = true ) const = 0;
8386

87+
// TODO QGIS 4: remove const qualifier
88+
8489
/**
8590
* Should be called, when the features should be committed but the editing session is not ended.
8691
*
8792
* \param layer The layer to commit
8893
* \returns True if successful
8994
*
90-
* TODO QGIS 3: remove const qualifier
9195
*/
9296
virtual bool saveEdits( QgsVectorLayer *layer ) const = 0;
9397

98+
// TODO QGIS 4: remove const qualifier
99+
94100
/**
95101
* Copy and move features with defined translation.
96102
*
@@ -101,7 +107,6 @@ class CORE_EXPORT QgsVectorLayerTools : public QObject
101107
* \param errorMsg If given, it will contain the error message
102108
* \returns True if all features could be copied.
103109
*
104-
* TODO QGIS 3: remove const qualifier
105110
*/
106111
virtual bool copyMoveFeatures( QgsVectorLayer *layer, QgsFeatureRequest &request SIP_INOUT, double dx = 0, double dy = 0, QString *errorMsg SIP_OUT = nullptr ) const;
107112

‎src/gui/attributetable/qgsattributetablemodel.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,11 @@ class GUI_EXPORT QgsAttributeTableModel: public QAbstractTableModel
221221
*/
222222
void setRequest( const QgsFeatureRequest &request );
223223

224+
// TODO QGIS 4: return copy instead of reference
225+
224226
/**
225227
* Gets the the feature request
226228
*/
227-
// TODO QGIS 3: return copy instead of reference
228229
const QgsFeatureRequest &request() const;
229230

230231
/**

‎src/gui/editorwidgets/core/qgssearchwidgetwrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class GUI_EXPORT QgsSearchWidgetWrapper : public QgsWidgetWrapper
179179
* \returns filter expression
180180
* \since QGIS 2.16
181181
*/
182-
// TODO QGIS 3.0 - make pure virtual
182+
// TODO QGIS 4.0 - make pure virtual
183183
virtual QString createExpression( FilterFlags flags ) const { Q_UNUSED( flags ); return QStringLiteral( "TRUE" ); }
184184

185185
/**

‎src/gui/qgsattributeform.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,25 +74,28 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
7474

7575
const QgsFeature &feature() { return mFeature; }
7676

77+
// TODO QGIS 4.0 - make private
78+
7779
/**
7880
* Hides the button box (OK/Cancel) and enables auto-commit
7981
* \note set Embed in QgsAttributeEditorContext in constructor instead
8082
*/
81-
// TODO QGIS 3.0 - make private
8283
void hideButtonBox();
8384

85+
// TODO QGIS 4.0 - make private
86+
8487
/**
8588
* Shows the button box (OK/Cancel) and disables auto-commit
8689
* \note set Embed in QgsAttributeEditorContext in constructor instead
8790
*/
88-
// TODO QGIS 3.0 - make private
8991
void showButtonBox();
9092

93+
// TODO QGIS 4.0 - make private
94+
9195
/**
9296
* Disconnects the button box (OK/Cancel) from the accept/resetValues slots
9397
* If this method is called, you have to create these connections from outside
9498
*/
95-
// TODO QGIS 3.0 - make private
9699
void disconnectButtonBox();
97100

98101
/**

‎src/gui/qgsmapcanvas.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ email : sherman at mrcc.com
7676
* Deprecated to be deleted, stuff from here should be moved elsewhere.
7777
* \note not available in Python bindings
7878
*/
79-
//TODO QGIS 3.0 - remove
79+
//TODO QGIS 4.0 - remove
8080
class QgsMapCanvas::CanvasProperties
8181
{
8282
public:

‎src/gui/qgsmaptoolcapture.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
112112

113113
protected:
114114

115+
// TODO QGIS 4.0 returns an enum instead of a magic constant
116+
115117
/**
116118
* Converts a map point to layer coordinates
117119
* \param mapPoint the point in map coordinates
@@ -121,9 +123,10 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
121123
* 1 if the current layer is null or not a vector layer
122124
* 2 if the transformation failed
123125
*/
124-
// TODO QGIS 3.0 returns an enum instead of a magic constant
125126
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
126127

128+
// TODO QGIS 4.0 returns an enum instead of a magic constant
129+
127130
/**
128131
* Converts a point to map coordinates and layer coordinates
129132
* \param p the input point
@@ -134,16 +137,16 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
134137
* 1 if the current layer is null or not a vector layer
135138
* 2 if the transformation failed
136139
*/
137-
// TODO QGIS 3.0 returns an enum instead of a magic constant
138140
int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
139141

142+
// TODO QGIS 4.0 returns an enum instead of a magic constant
143+
140144
/**
141145
* Fetches the original point from the source layer if it has the same
142146
* CRS as the current layer.
143147
* \returns 0 in case of success, 1 if not applicable (CRS mismatch), 2 in case of failure
144148
* \since QGIS 2.14
145149
*/
146-
// TODO QGIS 3.0 returns an enum instead of a magic constant
147150
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
148151

149152
/**
@@ -171,11 +174,12 @@ class GUI_EXPORT QgsMapToolCapture : public QgsMapToolAdvancedDigitizing
171174
*/
172175
QgsPoint mapPoint( const QgsPointXY &point ) const;
173176

177+
// TODO QGIS 4.0 returns an enum instead of a magic constant
178+
174179
/**
175180
* Adds a point to the rubber band (in map coordinates) and to the capture list (in layer coordinates)
176181
* \returns 0 in case of success, 1 if current layer is not a vector layer, 2 if coordinate transformation failed
177182
*/
178-
// TODO QGIS 3.0 returns an enum instead of a magic constant
179183
int addVertex( const QgsPointXY &point );
180184

181185
/**

‎src/gui/raster/qgsrasterrendererwidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GUI_EXPORT QgsRasterRendererWidget: public QWidget
3939

4040
public:
4141

42-
//TODO QGIS 3.0 - remove extent parameter, replace with map canvas parameter
42+
//TODO QGIS 4.0 - remove extent parameter, replace with map canvas parameter
4343
QgsRasterRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent )
4444
: mRasterLayer( layer )
4545
, mExtent( extent )

0 commit comments

Comments
 (0)
Please sign in to comment.