mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Correctly parse styles for layer in groups
This commit is contained in:
parent
39e0b7be7a
commit
6e85a893ea
@ -311,7 +311,8 @@ void QgsLayerTreeUtils::storeOriginalLayersProperties( QgsLayerTreeGroup *group,
|
||||
const QDomNodeList mlNodeList( doc->documentElement()
|
||||
.firstChildElement( QStringLiteral( "projectlayers" ) )
|
||||
.elementsByTagName( QStringLiteral( "maplayer" ) ) );
|
||||
for ( QgsLayerTreeNode *node : group->children() )
|
||||
|
||||
std::function<void ( QgsLayerTreeNode * )> _store = [ & ]( QgsLayerTreeNode * node )
|
||||
{
|
||||
if ( QgsLayerTree::isLayer( node ) )
|
||||
{
|
||||
@ -337,6 +338,19 @@ void QgsLayerTreeUtils::storeOriginalLayersProperties( QgsLayerTreeGroup *group,
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( QgsLayerTree::isGroup( node ) )
|
||||
{
|
||||
const QList<QgsLayerTreeNode *> constChildren( node->children( ) );
|
||||
for ( const auto &childNode : constChildren )
|
||||
{
|
||||
_store( childNode );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for ( QgsLayerTreeNode *node : group->children() )
|
||||
{
|
||||
_store( node );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user