Skip to content

Commit aceddae

Browse files
committedJul 31, 2016
QgsFeature cleanup, part 1
Deprecate some QgsFeature methods which take or return pointers, update other classes as required
1 parent 429fe2d commit aceddae

File tree

136 files changed

+869
-840
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+869
-840
lines changed
 

‎doc/api_break.dox

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,15 @@ attributeIndexes(), pkAttributeIndexes(), isSaveAndLoadStyleToDBSupported()</li>
212212
</li>
213213
</ul>
214214

215+
\subsection qgis_api_break_3_0_QgsFeature QgsFeature
216+
217+
<ul>
218+
<li>geometryAndOwnership() has been removed. Use geometry() instead.</li>
219+
<li>setGeometryAndOwnership() has been removed. Use setGeometry() instead.</li>
220+
<li>The setGeometry( QgsGeometry* ) method has been removed, use setGeometry( const QgsGeometry& ) instead.</li>
221+
<li>setFields( const QgsFields*, bool ) has been removed, use setFields( const QgsFields&, bool ) instead.</li>
222+
</ul>
223+
215224
\subsection qgis_api_break_3_0_QgsGroupWMSDataDialog QgsGroupWMSDataDialog
216225

217226
<ul>
@@ -384,6 +393,12 @@ be returned instead of a null pointer if no transformation is required.</li>
384393
<li>setCoordinateTransform() now takes a QgsCoordinateTransform reference, not a pointer. An invalid QgsCoordinateTransform should be used instead of a null pointer if no transformation is required.</li>
385394
</ul>
386395

396+
\subsection qgis_api_break_3_0_QgsRubberBand QgsRubberBand
397+
398+
<ul>
399+
<li>setToGeometry() and addGeometry() now take geometry references, not pointers.</li>
400+
</ul>
401+
387402
\subsection qgis_api_break_3_0_QgsPalLayerSettings QgsPalLayerSettings
388403

389404
<ul>
@@ -418,6 +433,15 @@ plugins calling this method will need to be updated.</li>
418433
setExcludeAttributesWms()</li>
419434
<li>excludeAttributesWFS() and setExcludeAttributesWFS() have been renamed to excludeAttributesWfs() and
420435
setExcludeAttributesWfs()</li>
436+
<li>changeGeometry() now accepts a geometry reference, not a pointer.</li>
437+
<li>The geometryChanged() signal now uses a const QgsGeometry reference.</li>
438+
</ul>
439+
440+
\subsection qgis_api_break_3_0_QgsVectorLayerEditBuffer QgsVectorLayerEditBuffer
441+
442+
<ul>
443+
<li>changeGeometry() now accepts a geometry reference, not a pointer.</li>
444+
<li>The geometryChanged() signal now uses a const QgsGeometry reference.</li>
421445
</ul>
422446

423447
\subsection qgis_api_break_3_0_QgsVectorLayerImport QgsVectorLayerImport
@@ -429,6 +453,13 @@ pointers makes for more robust, safer code. Use an invalid (default constructed)
429453
in code which previously passed a null pointer to QgsVectorLayerImport.</li>
430454
</ul>
431455

456+
\subsection qgis_api_break_3_0_QgsVectorLayerUndoCommand QgsVectorLayerUndoCommand
457+
458+
<ul>
459+
<li>QgsVectorLayerUndoCommandChangeGeometry constructor now accepts a geometry reference, not a pointer.</li>
460+
</ul>
461+
462+
432463
\subsection qgis_api_break_3_0_QgsPointLocator QgsPointLocator
433464

434465
<ul>

‎python/core/qgsfeature.sip

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ class QgsFeature
333333
*
334334
* @returns pointer to feature's geometry
335335
* @see constGeometry
336-
* @see geometryAndOwnership
337336
* @see setGeometry
338337
*/
339338
QgsGeometry* geometry();
@@ -351,58 +350,14 @@ class QgsFeature
351350
*/
352351
const QgsGeometry* constGeometry() const;
353352

354-
/** Get the geometry object associated with this feature, and transfer ownership of the
355-
* geometry to the caller. The caller assumes responsibility for the QgsGeometry*'s destruction.
356-
* @returns pointer to feature's geometry
357-
* @see geometry
358-
* @see setGeometry
359-
* @deprecated use constGeometry() instead
360-
*/
361-
QgsGeometry *geometryAndOwnership() /Factory,Deprecated/;
362-
363353
/** Set this feature's geometry from another QgsGeometry object. This method performs a deep copy
364354
* of the geometry.
365355
* @param geom new feature geometry
366356
* @see geometry
367357
* @see constGeometry
368-
* @see geometryAndOwnership
369-
* @see setGeometryAndOwnership
370358
*/
371359
void setGeometry( const QgsGeometry& geom );
372360

373-
/** Set this feature's geometry from a QgsGeometry pointer. Ownership of the geometry is transferred
374-
* to the feature.
375-
* @param geom new feature geometry
376-
* @note not available in python bindings
377-
* @see geometry
378-
* @see constGeometry
379-
* @see geometryAndOwnership
380-
* @see setGeometryAndOwnership
381-
*/
382-
// void setGeometry( QgsGeometry* geom /Transfer/ );
383-
384-
/** Set this feature's geometry from WKB. This feature assumes responsibility for destroying the
385-
* created geometry.
386-
* @param geom geometry as WKB
387-
* @param length size of WKB
388-
* @see setGeometry
389-
* @see geometry
390-
* @see constGeometry
391-
* @see geometryAndOwnership
392-
* @deprecated will be removed in QGIS 3.0
393-
*/
394-
void setGeometryAndOwnership( unsigned char * geom /Transfer/, int length ) /Deprecated/;
395-
396-
/** Assign a field map with the feature to allow attribute access by attribute name.
397-
* @param fields The attribute fields which this feature holds
398-
* @param initAttributes If true, attributes are initialized. Clears any data previously assigned.
399-
* C++: Defaults to false
400-
* Python: Defaults to true
401-
* @deprecated use setFields( const QgsFields& fields, bool initAttributes = false ) instead
402-
* @note not available in Python bindings
403-
*/
404-
//void setFields( const QgsFields* fields, bool initAttributes = true );
405-
406361
/** Assign a field map with the feature to allow attribute access by attribute name.
407362
* @param fields The attribute fields which this feature holds
408363
* @param initAttributes If true, attributes are initialized. Clears any data previously assigned.

0 commit comments

Comments
 (0)