Skip to content

Commit 09407c1

Browse files
authored
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

+15
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

+7-7
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

+4
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

+24
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

+5-10
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

+4
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

+21
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

+40
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

+2-1
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
/**

0 commit comments

Comments
 (0)