Using QgsMapLayer's title for QgsComposerLayerItem

This commit is contained in:
D'Hont René-Luc 2013-05-26 22:06:38 +02:00
parent 287cce06ad
commit cca0003513

View File

@ -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 );