Skip to content
Permalink
Browse files

Fix removing composer legend items. Fix #7874 Fix #7464

  • Loading branch information
NathanW2 committed May 28, 2013
1 parent 34ef14a commit 1dc75dd64fcd4613379f9c28e161c1bd7afa22d1
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/app/composer/qgscomposerlegendwidget.cpp
@@ -684,11 +684,13 @@ void QgsComposerLegendWidget::on_mRemoveToolButton_clicked()
return;
}

QModelIndexList selection = selectionModel->selectedIndexes();
for ( int i = selection.size() - 1; i >= 0; --i )
QList<QPersistentModelIndex> indexes;
foreach(const QModelIndex &index, selectionModel->selectedIndexes())
indexes << index;

foreach(const QPersistentModelIndex index, indexes)
{
QModelIndex parentIndex = selection.at( i ).parent();
itemModel->removeRow( selection.at( i ).row(), parentIndex );
itemModel->removeRow( index.row(), index.parent() );
}

mLegend->adjustBoxSize();

0 comments on commit 1dc75dd

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