Skip to content

Commit

Permalink
Fix removing composer legend items. Fix #7874 Fix #7464
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed May 28, 2013
1 parent 34ef14a commit 1dc75dd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 1dc75dd

Please sign in to comment.