Skip to content

Commit

Permalink
Using QgsMapLayer's title for QgsComposerLayerItem
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed May 29, 2013
1 parent 287cce0 commit cca0003
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/composer/qgslegendmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit cca0003

Please sign in to comment.