mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[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.
This commit is contained in:
parent
2b36dea1f7
commit
58c34ae361
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user