Skip to content

Commit 27696e8

Browse files
elpasonyalldawson
authored andcommitted
Update layer transform context when adding them to a project
1 parent 87998f7 commit 27696e8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/core/qgsproject.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2786,11 +2786,18 @@ QList<QgsMapLayer *> QgsProject::addMapLayers(
27862786
bool addToLegend,
27872787
bool takeOwnership )
27882788
{
2789-
const QList<QgsMapLayer *> myResultList = mLayerStore->addMapLayers( layers, takeOwnership );
2789+
const QList<QgsMapLayer *> myResultList { mLayerStore->addMapLayers( layers, takeOwnership ) };
27902790
if ( !myResultList.isEmpty() )
27912791
{
2792+
// Update transform context
2793+
for ( auto &l : myResultList )
2794+
{
2795+
l->setTransformContext( transformContext() );
2796+
}
27922797
if ( addToLegend )
2798+
{
27932799
emit legendLayersAdded( myResultList );
2800+
}
27942801
}
27952802

27962803
if ( mAuxiliaryStorage )

0 commit comments

Comments
 (0)