Skip to content
Permalink
Browse files

[composer] Default to setting a map for new legend items

It's friendlier for users, who may not realise they need to set
a map before they can filter legends.
  • Loading branch information
nyalldawson committed Oct 21, 2014
1 parent 2b36dea commit 58c34ae3612592a4da3d2afe4ae81a2294e631eb
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/gui/qgscomposerview.cpp
@@ -845,6 +845,11 @@ void QgsComposerView::mouseReleaseEvent( QMouseEvent* e )
else
{
QgsComposerLegend* newLegend = new QgsComposerLegend( composition() );
QList<const QgsComposerMap*> mapItemList = composition()->composerMapItems();
if ( mapItemList.size() > 0 )
{
newLegend->setComposerMap( mapItemList.at( 0 ) );
}
newLegend->setSceneRect( QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(), mRubberBandItem->rect().width(), mRubberBandItem->rect().height() ) );
composition()->addComposerLegend( newLegend );
newLegend->updateLegend();

0 comments on commit 58c34ae

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