Skip to content
Permalink
Browse files

Add test to save and reload embedded groups

  • Loading branch information
m-kuhn committed Jun 9, 2018
1 parent 96f7426 commit c3747e95543934835808507aaf00612d8ca72f61
Showing with 16 additions and 0 deletions.
  1. +16 −0 tests/src/core/testqgslayertree.cpp
@@ -570,6 +570,22 @@ void TestQgsLayerTree::testEmbeddedGroup()
{
QVERIFY( QgsLayerTree::toLayer( child )->layer() );
}
projectMaster.layerTreeRoot()->addChildNode( embeddedGroup );

QString projectMasterFilename = dirPath + QStringLiteral( "/projectMaster.qgs" );
projectMaster.write( projectMasterFilename );
projectMaster.clear();

QgsProject projectMasterCopy;
projectMasterCopy.read( projectMasterFilename );
QgsLayerTreeGroup *masterEmbeddedGroup = projectMasterCopy.layerTreeRoot()->findGroup( QStringLiteral( "Embed" ) );
QVERIFY( masterEmbeddedGroup );
QCOMPARE( masterEmbeddedGroup->children().size(), 3 );

for ( QgsLayerTreeNode *child : masterEmbeddedGroup->children() )
{
QVERIFY( QgsLayerTree::toLayer( child )->layer() );
}
}


0 comments on commit c3747e9

Please sign in to comment.
You can’t perform that action at this time.