diff --git a/python/core/auto_generated/qgsmaplayer.sip.in b/python/core/auto_generated/qgsmaplayer.sip.in index 3f39bf04947..71ab1d028c9 100644 --- a/python/core/auto_generated/qgsmaplayer.sip.in +++ b/python/core/auto_generated/qgsmaplayer.sip.in @@ -1490,7 +1490,10 @@ Sets the coordinate transform context to ``transformContext`` QgsProject *project() const; %Docstring -Returns the parent project if available. +Returns the parent project if this map layer is added to a project. +Otherwise returns ``None`` + +.. versionadded:: 3.18 %End signals: diff --git a/src/core/qgsmaplayer.h b/src/core/qgsmaplayer.h index bb9aaa974d5..e4e5e2f34bf 100644 --- a/src/core/qgsmaplayer.h +++ b/src/core/qgsmaplayer.h @@ -1336,7 +1336,10 @@ class CORE_EXPORT QgsMapLayer : public QObject #endif /** - * Returns the parent project if available. + * Returns the parent project if this map layer is added to a project. + * Otherwise returns NULLPTR + * + * \since QGIS 3.18 */ QgsProject *project() const;