We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34ef14a commit 1dc75ddCopy full SHA for 1dc75dd
src/app/composer/qgscomposerlegendwidget.cpp
@@ -684,11 +684,13 @@ void QgsComposerLegendWidget::on_mRemoveToolButton_clicked()
684
return;
685
}
686
687
- QModelIndexList selection = selectionModel->selectedIndexes();
688
- for ( int i = selection.size() - 1; i >= 0; --i )
+ QList<QPersistentModelIndex> indexes;
+ foreach(const QModelIndex &index, selectionModel->selectedIndexes())
689
+ indexes << index;
690
+
691
+ foreach(const QPersistentModelIndex index, indexes)
692
{
- QModelIndex parentIndex = selection.at( i ).parent();
- itemModel->removeRow( selection.at( i ).row(), parentIndex );
693
+ itemModel->removeRow( index.row(), index.parent() );
694
695
696
mLegend->adjustBoxSize();
0 commit comments