diff --git a/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in b/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in index b81ce011736..9d985b5ffb5 100644 --- a/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in +++ b/python/core/auto_generated/layertree/qgslayertreeregistrybridge.sip.in @@ -34,6 +34,9 @@ from the map layer registry. struct InsertionPoint { InsertionPoint( QgsLayerTreeGroup *parent, int position ); +%Docstring +Construcs an insertion point as layer tree group with its corresponding position. +%End QgsLayerTreeGroup *parent; int position; }; @@ -54,7 +57,7 @@ Create the instance that synchronizes given project with a layer tree root Set where the new layers should be inserted - can be used to follow current selection. By default it is root group with zero index. -.. deprecated:: since QGIS 3.10 +.. deprecated:: since QGIS 3.10 use setLayerInsertionPoint( const InsertionPoint &insertionPoint ) instead %End void setLayerInsertionPoint( const InsertionPoint &insertionPoint ); diff --git a/python/gui/auto_generated/qgisinterface.sip.in b/python/gui/auto_generated/qgisinterface.sip.in index 94ad6cd750a..648ed080511 100644 --- a/python/gui/auto_generated/qgisinterface.sip.in +++ b/python/gui/auto_generated/qgisinterface.sip.in @@ -634,8 +634,8 @@ Take screenshots for user documentation virtual QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint() = 0; %Docstring -Returns the insertion group with its insertion index -In Python, returns a tuple (insertionGroup, insertionIndex) +Returns the insertion point. +This represents the current layer tree group and index where newly added map layers should be inserted into. .. versionadded:: 3.10 %End diff --git a/src/core/layertree/qgslayertreeregistrybridge.h b/src/core/layertree/qgslayertreeregistrybridge.h index 258304b4e38..899d6cdef37 100644 --- a/src/core/layertree/qgslayertreeregistrybridge.h +++ b/src/core/layertree/qgslayertreeregistrybridge.h @@ -47,16 +47,18 @@ class CORE_EXPORT QgsLayerTreeRegistryBridge : public QObject public: /** - * A structure to define the insertion point to the layer tree + * A structure to define the insertion point to the layer tree. + * This represents the current layer tree group and index where newly added map layers should be inserted into. * \since QGIS 3.10 */ struct InsertionPoint { + //! Construcs an insertion point as layer tree group with its corresponding position. InsertionPoint( QgsLayerTreeGroup *parent, int position ) : parent( parent ), position( position ) {} - QgsLayerTreeGroup *parent; - int position; + QgsLayerTreeGroup *parent = nullptr; + int position = 0; }; //! Create the instance that synchronizes given project with a layer tree root @@ -71,7 +73,7 @@ class CORE_EXPORT QgsLayerTreeRegistryBridge : public QObject /** * Set where the new layers should be inserted - can be used to follow current selection. * By default it is root group with zero index. - * \deprecated since QGIS 3.10 + * \deprecated since QGIS 3.10 use setLayerInsertionPoint( const InsertionPoint &insertionPoint ) instead */ Q_DECL_DEPRECATED void setLayerInsertionPoint( QgsLayerTreeGroup *parentGroup, int index ) SIP_DEPRECATED; diff --git a/src/gui/qgisinterface.h b/src/gui/qgisinterface.h index 60433e39d35..bcc4b545633 100644 --- a/src/gui/qgisinterface.h +++ b/src/gui/qgisinterface.h @@ -564,8 +564,8 @@ class GUI_EXPORT QgisInterface : public QObject virtual void takeAppScreenShots( const QString &saveDirectory, const int categories = 0 ) {Q_UNUSED( saveDirectory ) Q_UNUSED( categories );} /** - * Returns the insertion group with its insertion index - * In Python, returns a tuple (insertionGroup, insertionIndex) + * Returns the insertion point. + * This represents the current layer tree group and index where newly added map layers should be inserted into. * \since QGIS 3.10 */ virtual QgsLayerTreeRegistryBridge::InsertionPoint layerTreeInsertionPoint() = 0;