mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
[layertree] Preserve the order of layers when adding several layers at once
This commit is contained in:
parent
974a3eb3a8
commit
be7c4d0822
@ -47,10 +47,11 @@ void QgsLayerTreeRegistryBridge::layersAdded( QList<QgsMapLayer*> layers )
|
||||
if ( !mEnabled )
|
||||
return;
|
||||
|
||||
int i = 0;
|
||||
foreach ( QgsMapLayer* layer, layers )
|
||||
{
|
||||
// add new layer to the top
|
||||
QgsLayerTreeLayer* nodeLayer = mInsertionPointGroup->insertLayer( mInsertionPointIndex, layer );
|
||||
QgsLayerTreeLayer* nodeLayer = mInsertionPointGroup->insertLayer( mInsertionPointIndex + i++, layer );
|
||||
|
||||
// check whether the layer is marked as embedded
|
||||
QString projectFile = QgsProject::instance()->layerIsEmbedded( nodeLayer->layerId() );
|
||||
|
Loading…
x
Reference in New Issue
Block a user