Skip to content
Permalink
Browse files

Using QgsMapLayer's title for QgsComposerLayerItem

  • Loading branch information
rldhont committed May 29, 2013
1 parent 287cce0 commit cca0003513c2701cfc98c5269e5ffebb5d289425
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/core/composer/qgslegendmodel.cpp
@@ -440,6 +440,11 @@ void QgsLegendModel::addLayer( QgsMapLayer* theMapLayer )
}

QgsComposerLayerItem* layerItem = new QgsComposerLayerItem( theMapLayer->name() );
if ( theMapLayer->title() != "" )
{
layerItem->setText( theMapLayer->title() );
layerItem->setUserText( theMapLayer->title() );
}
layerItem->setLayerID( theMapLayer->id() );
layerItem->setDefaultStyle();
layerItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );

0 comments on commit cca0003

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