Skip to content

Commit 16a64ed

Browse files
committed
Deprecate some methods, dox++
1 parent fa20279 commit 16a64ed

24 files changed

+119
-50
lines changed

python/core/auto_generated/expression/qgsexpression.sip.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ Returns parser error details including location of error.
144144

145145
const QgsExpressionNode *rootNode() const;
146146
%Docstring
147-
Returns root node of the expression. Root node is null is parsing has failed
147+
Returns the root node of the expression.
148+
149+
The root node is ``None`` if parsing has failed.
148150
%End
149151

150152
bool prepare( const QgsExpressionContext *context );

python/core/auto_generated/layertree/qgslayertreemodellegendnode.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Construct the node with pointer to its parent layer node
165165

166166
QgsRenderContext *createTemporaryRenderContext() const /Factory/;
167167
%Docstring
168-
Returns a temporary context or null if legendMapViewData are not valid
168+
Returns a temporary context or ``None`` if legendMapViewData are not valid
169169
%End
170170

171171
protected:

python/core/auto_generated/qgsmapthemecollection.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Initialize layer record with a map layer - it will be stored as a weak pointer
4747

4848
QgsMapLayer *layer() const;
4949
%Docstring
50-
Returns map layer or null if the layer does not exist anymore
50+
Returns map layer or ``None`` if the layer does not exist anymore
5151
%End
5252

5353
void setLayer( QgsMapLayer *layer );

python/core/auto_generated/qgssqlstatement.sip.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ successful
5454

5555
const QgsSQLStatement::Node *rootNode() const;
5656
%Docstring
57-
Returns root node of the statement. Root node is null is parsing has failed
57+
Returns the root node of the statement.
58+
The root node is ``None`` if parsing has failed.
5859
%End
5960

6061
QString statement() const;

python/core/auto_generated/qgsvectorlayerjoininfo.sip.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Sets weak reference to the joined layer
3434
%End
3535
QgsVectorLayer *joinLayer() const;
3636
%Docstring
37-
Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
37+
Returns joined layer (may be ``None`` if the reference was set by layer ID and not resolved yet)
3838
%End
3939

4040
void setJoinLayerId( const QString &layerId );
@@ -66,11 +66,11 @@ Returns name of the field of joined layer that will be used for join
6666

6767
void setPrefix( const QString &prefix );
6868
%Docstring
69-
Sets prefix of fields from the joined layer. If null, joined layer's name will be used.
69+
Sets prefix of fields from the joined layer. If ``None``, joined layer's name will be used.
7070
%End
7171
QString prefix() const;
7272
%Docstring
73-
Returns prefix of fields from the joined layer. If null, joined layer's name will be used.
73+
Returns prefix of fields from the joined layer. If ``None``, joined layer's name will be used.
7474
%End
7575

7676
void setUsingMemoryCache( bool enabled );

python/core/auto_generated/symbology/qgsrulebasedrenderer.sip.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ delete child rule
394394

395395
QgsRuleBasedRenderer::Rule *takeChild( QgsRuleBasedRenderer::Rule *rule ) /TransferBack/;
396396
%Docstring
397-
take child rule out, set parent as null
397+
take child rule out, set parent as ``None``
398398
%End
399399

400400
QgsRuleBasedRenderer::Rule *takeChildAt( int i ) /TransferBack/;
401401
%Docstring
402-
take child rule out, set parent as null
402+
take child rule out, set parent as ``None``
403403
%End
404404

405405
QgsRuleBasedRenderer::Rule *findRuleByKey( const QString &key );

python/core/auto_generated/symbology/qgssymbol.sip.in

+38-8
Original file line numberDiff line numberDiff line change
@@ -545,18 +545,31 @@ Sets the original value variable value for data defined symbology
545545
.. versionadded:: 2.12
546546
%End
547547

548-
QgsUnitTypes::RenderUnit outputUnit() const;
548+
QgsUnitTypes::RenderUnit outputUnit() const /Deprecated/;
549549
%Docstring
550-
Returns the output unit for the context
550+
Returns the output unit for the context.
551+
552+
.. deprecated:: No longer used and will be removed in QGIS 4.0
551553
%End
552554

553-
void setOutputUnit( QgsUnitTypes::RenderUnit u );
555+
void setOutputUnit( QgsUnitTypes::RenderUnit u ) /Deprecated/;
554556
%Docstring
555-
Sets the output unit for the context
557+
Sets the output unit for the context.
558+
559+
.. deprecated:: No longer used and will be removed in QGIS 4.0
556560
%End
557561

558-
QgsMapUnitScale mapUnitScale() const;
559-
void setMapUnitScale( const QgsMapUnitScale &scale );
562+
QgsMapUnitScale mapUnitScale() const /Deprecated/;
563+
%Docstring
564+
565+
.. deprecated:: Will be removed in QGIS 4.0
566+
%End
567+
568+
void setMapUnitScale( const QgsMapUnitScale &scale ) /Deprecated/;
569+
%Docstring
570+
571+
.. deprecated:: Will be removed in QGIS 4.0
572+
%End
560573

561574
qreal opacity() const;
562575
%Docstring
@@ -577,7 +590,18 @@ Sets the ``opacity`` for the symbol.
577590
%End
578591

579592
bool selected() const;
593+
%Docstring
594+
Returns ``True`` if symbols should be rendered using the selected symbol coloring and style.
595+
596+
.. seealso:: :py:func:`setSelected`
597+
%End
598+
580599
void setSelected( bool selected );
600+
%Docstring
601+
Sets whether symbols should be rendered using the selected symbol coloring and style.
602+
603+
.. seealso:: :py:func:`selected`
604+
%End
581605

582606
QgsSymbol::RenderHints renderHints() const;
583607
%Docstring
@@ -594,9 +618,10 @@ Sets rendering hint flags for the symbol.
594618
%End
595619

596620
void setFeature( const QgsFeature *f );
621+
597622
const QgsFeature *feature() const;
598623
%Docstring
599-
Current feature being rendered - may be null
624+
Returns the current feature being rendered. This may be ``None``.
600625
%End
601626

602627
void setOriginalGeometryType( QgsWkbTypes::GeometryType type );
@@ -658,7 +683,12 @@ Sets the part number of current geometry
658683
%End
659684

660685
double outputLineWidth( double width ) const;
661-
double outputPixelSize( double size ) const;
686+
687+
double outputPixelSize( double size ) const /Deprecated/;
688+
%Docstring
689+
690+
.. deprecated:: Use the size conversion methods in QgsRenderContext instead.
691+
%End
662692

663693

664694
QgsExpressionContextScope *expressionContextScope();

python/gui/auto_generated/layertree/qgslayertreeview.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ instance to provide custom context menus (opened upon right-click).
243243

244244
virtual QMenu *createContextMenu() = 0 /Factory/;
245245
%Docstring
246-
Returns a newly created menu instance (or null pointer on error)
246+
Returns a newly created menu instance (or ``None`` on error)
247247
%End
248248
};
249249

src/3d/chunks/qgschunknode_p.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ class QgsChunkNode
109109
//! Returns current state of the node
110110
State state() const { return mState; }
111111

112-
//! Returns node's entry in the loader queue. Not null only when in QueuedForLoad / QueuedForUpdate state
112+
//! Returns node's entry in the loader queue. Not NULLPTR only when in QueuedForLoad / QueuedForUpdate state
113113
QgsChunkListEntry *loaderQueueEntry() const { return mLoaderQueueEntry; }
114-
//! Returns node's entry in the replacement queue. Not null only when in Loaded / QueuedForUpdate / Updating state
114+
//! Returns node's entry in the replacement queue. Not NULLPTR only when in Loaded / QueuedForUpdate / Updating state
115115
QgsChunkListEntry *replacementQueueEntry() const { return mReplacementQueueEntry; }
116-
//! Returns loader of the node. Not null only when in Loading state
116+
//! Returns loader of the node. Not NULLPTR only when in Loading state
117117
QgsChunkLoader *loader() const { return mLoader; }
118-
//! Returns associated entity (3D object). Not null only when Loaded / QueuedForUpdate / Updating state
118+
//! Returns associated entity (3D object). Not NULLPTR only when Loaded / QueuedForUpdate / Updating state
119119
Qt3DCore::QEntity *entity() const { return mEntity; }
120-
//! Returns updater job. Not null only when in Updating state
120+
//! Returns updater job. Not NULLPTR only when in Updating state
121121
QgsChunkQueueJob *updater() const { return mUpdater; }
122122

123123
//! Returns TRUE if all child chunks are available and thus this node could be swapped to the child nodes

src/3d/qgs3dmapscene.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity
5959

6060
//! Returns camera controller
6161
QgsCameraController *cameraController() { return mCameraController; }
62-
//! Returns terrain entity (may be temporarily null)
62+
//! Returns terrain entity (may be temporarily NULLPTR)
6363
QgsTerrainEntity *terrainEntity() { return mTerrain; }
6464

6565
//! Resets camera view to show the whole scene (top view)

src/app/3d/qgs3dmapcanvas.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class Qgs3DMapCanvas : public QWidget
9393
//! Root entity of the 3D scene
9494
Qgs3DMapScene *mScene = nullptr;
9595

96-
//! Active map tool that receives events (if null then mouse/keyboard events are used for camera manipulation)
96+
//! Active map tool that receives events (if NULLPTR then mouse/keyboard events are used for camera manipulation)
9797
Qgs3DMapTool *mMapTool = nullptr;
9898
};
9999

src/app/3d/qgsvectorlayer3drendererwidget.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class QgsSingleSymbol3DRendererWidget : public QWidget
4242
//! no transfer of ownership
4343
void setLayer( QgsVectorLayer *layer );
4444

45-
//! cloned symbol or null
45+
//! Returns the cloned symbol or NULLPTR.
4646
QgsAbstract3DSymbol *symbol();
4747

4848
signals:

src/core/expression/qgsexpression.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ class CORE_EXPORT QgsExpression
228228
*/
229229
QList<QgsExpression::ParserError> parserErrors() const;
230230

231-
//! Returns root node of the expression. Root node is null is parsing has failed
231+
/**
232+
* Returns the root node of the expression.
233+
*
234+
* The root node is NULLPTR if parsing has failed.
235+
*/
232236
const QgsExpressionNode *rootNode() const;
233237

234238
/**

src/core/layertree/qgslayertreemodel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ class CORE_EXPORT QgsLayerTreeModel : public QAbstractItemModel
373373
#ifndef SIP_RUN
374374
struct LayerLegendTree
375375
{
376-
//! Pointer to parent for each active node. Top-level nodes have null parent. Pointers are not owned.
376+
//! Pointer to parent for each active node. Top-level nodes have NULLPTR parent. Pointers are not owned.
377377
QMap<QgsLayerTreeModelLegendNode *, QgsLayerTreeModelLegendNode *> parents;
378378
//! List of children for each active node. Top-level nodes are under NULLPTR key. Pointers are not owned.
379379
QMap<QgsLayerTreeModelLegendNode *, QList<QgsLayerTreeModelLegendNode *> > children;

src/core/layertree/qgslayertreemodellegendnode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class CORE_EXPORT QgsLayerTreeModelLegendNode : public QObject
163163
//! Construct the node with pointer to its parent layer node
164164
explicit QgsLayerTreeModelLegendNode( QgsLayerTreeLayer *nodeL, QObject *parent SIP_TRANSFERTHIS = nullptr );
165165

166-
//! Returns a temporary context or null if legendMapViewData are not valid
166+
//! Returns a temporary context or NULLPTR if legendMapViewData are not valid
167167
QgsRenderContext *createTemporaryRenderContext() const SIP_FACTORY;
168168

169169
protected:

src/core/layertree/qgslayertreenode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ class CORE_EXPORT QgsLayerTreeNode : public QObject
266266
//! type of the node - determines which subclass is used
267267
NodeType mNodeType;
268268
bool mChecked;
269-
//! pointer to the parent node - null in case of root node
269+
//! pointer to the parent node - NULLPTR in case of root node
270270
QgsLayerTreeNode *mParent = nullptr;
271271
//! list of children - node is responsible for their deletion
272272
QList<QgsLayerTreeNode *> mChildren;

src/core/qgsmapthemecollection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
7373
return !( *this == other );
7474
}
7575

76-
//! Returns map layer or null if the layer does not exist anymore
76+
//! Returns map layer or NULLPTR if the layer does not exist anymore
7777
QgsMapLayer *layer() const { return mLayer; }
7878

7979
//! Sets the map layer for this record

src/core/qgspointlocator.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ class CORE_EXPORT QgsPointLocator : public QObject
299299
QHash<QgsFeatureId, QgsGeometry *> mGeoms;
300300
std::unique_ptr< SpatialIndex::ISpatialIndex > mRTree;
301301

302-
//! flag whether the layer is currently empty (i.e. mRTree is null but it is not necessary to rebuild it)
302+
//! flag whether the layer is currently empty (i.e. mRTree is NULLPTR but it is not necessary to rebuild it)
303303
bool mIsEmptyLayer = false;
304304

305305

src/core/qgssqlstatement.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ class CORE_EXPORT QgsSQLStatement
6868

6969
class Node;
7070

71-
//! Returns root node of the statement. Root node is null is parsing has failed
71+
/**
72+
* Returns the root node of the statement.
73+
* The root node is NULLPTR if parsing has failed.
74+
*/
7275
const QgsSQLStatement::Node *rootNode() const;
7376

7477
/**

src/core/qgsvectorlayerjoininfo.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CORE_EXPORT QgsVectorLayerJoinInfo
4141

4242
//! Sets weak reference to the joined layer
4343
void setJoinLayer( QgsVectorLayer *layer ) { mJoinLayerRef = QgsVectorLayerRef( layer ); }
44-
//! Returns joined layer (may be null if the reference was set by layer ID and not resolved yet)
44+
//! Returns joined layer (may be NULLPTR if the reference was set by layer ID and not resolved yet)
4545
QgsVectorLayer *joinLayer() const { return mJoinLayerRef.get(); }
4646

4747
//! Sets ID of the joined layer. It will need to be overwritten by setJoinLayer() to a reference to real layer
@@ -59,9 +59,9 @@ class CORE_EXPORT QgsVectorLayerJoinInfo
5959
//! Returns name of the field of joined layer that will be used for join
6060
QString joinFieldName() const { return mJoinFieldName; }
6161

62-
//! Sets prefix of fields from the joined layer. If null, joined layer's name will be used.
62+
//! Sets prefix of fields from the joined layer. If NULLPTR, joined layer's name will be used.
6363
void setPrefix( const QString &prefix ) { mPrefix = prefix; }
64-
//! Returns prefix of fields from the joined layer. If null, joined layer's name will be used.
64+
//! Returns prefix of fields from the joined layer. If NULLPTR, joined layer's name will be used.
6565
QString prefix() const { return mPrefix; }
6666

6767
//! Sets whether values from the joined layer should be cached in memory to speed up lookups
@@ -219,7 +219,7 @@ class CORE_EXPORT QgsVectorLayerJoinInfo
219219
//! True if the join is cached in virtual memory
220220
bool mMemoryCache = false;
221221

222-
//! Subset of fields to use from joined layer. null = use all fields
222+
//! Subset of fields to use from joined layer. NULLPTR = use all fields
223223
std::shared_ptr<QStringList> mJoinFieldsSubset;
224224

225225
// caching support

src/core/symbology/qgsrulebasedrenderer.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ class CORE_EXPORT QgsRuleBasedRenderer : public QgsFeatureRenderer
402402
//! delete child rule
403403
void removeChildAt( int i );
404404

405-
//! take child rule out, set parent as null
405+
//! take child rule out, set parent as NULLPTR
406406
QgsRuleBasedRenderer::Rule *takeChild( QgsRuleBasedRenderer::Rule *rule ) SIP_TRANSFERBACK;
407407

408-
//! take child rule out, set parent as null
408+
//! take child rule out, set parent as NULLPTR
409409
QgsRuleBasedRenderer::Rule *takeChildAt( int i ) SIP_TRANSFERBACK;
410410

411411
/**

0 commit comments

Comments
 (0)