Skip to content
Permalink
Browse files

Set visibility of layers for embedded groups (ticket #4097)

  • Loading branch information
mhugent committed Jul 21, 2011
1 parent 7eed4b9 commit d02c4bef94be82dca4a4fcaed47d56194c9fc131
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/app/legend/qgslegend.cpp
@@ -697,6 +697,7 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
for ( int j = 0; j < groupChildren.size(); ++j )
{
QDomElement childElem = groupChildren.at( j ).toElement();
bool visible = ( childElem.attribute( "checked" ).compare( "Qt::Checked", Qt::CaseInsensitive ) == 0 );
QString tagName = childElem.tagName();
if ( tagName == "legendlayer" )
{
@@ -717,6 +718,11 @@ QgsLegendGroup* QgsLegend::addEmbeddedGroup( const QString& groupName, const QSt
{
group->insertChild( group->childCount(), cItem );
}

if( !visible )
{
cItem->setCheckState( 0, Qt::Unchecked );
}
}
else if ( tagName == "legendgroup" )
{
@@ -1175,6 +1181,7 @@ bool QgsLegend::readXML( QgsLegendGroup *parent, const QDomNode &node )
if ( childelem.attribute( "embedded" ) == "1" )
{
theGroup = addEmbeddedGroup( name, QgsProject::instance()->readPath( childelem.attribute( "project" ) ) );
updateGroupCheckStates( theGroup );
}
else
{

0 comments on commit d02c4be

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