Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Multi relation removal
Let the user select multiple relations and delete them.
  • Loading branch information
pvalsecc authored and m-kuhn committed Nov 8, 2016
1 parent 72fddb8 commit aaa3117
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/qgsrelationmanagerdialog.cpp
Expand Up @@ -134,8 +134,11 @@ void QgsRelationManagerDialog::on_mBtnDiscoverRelations_clicked()

void QgsRelationManagerDialog::on_mBtnRemoveRelation_clicked()
{
if ( mRelationsTable->currentIndex().isValid() )
mRelationsTable->removeRow( mRelationsTable->currentItem()->row() );
const QModelIndexList rows = mRelationsTable->selectionModel()->selectedRows();
for ( int i = rows.size() - 1; i >= 0; --i )
{
mRelationsTable->removeRow( rows[i].row() );
}
}

QList< QgsRelation > QgsRelationManagerDialog::relations()
Expand Down
3 changes: 3 additions & 0 deletions src/ui/qgsrelationmanagerdialogbase.ui
Expand Up @@ -16,6 +16,9 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="mRelationsTable">
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
Expand Down

0 comments on commit aaa3117

Please sign in to comment.