Skip to content
Permalink
Browse files

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 aaa3117bd5cf7dc0702f3b26f91a90b4ae51a16f
Showing with 8 additions and 2 deletions.
  1. +5 −2 src/app/qgsrelationmanagerdialog.cpp
  2. +3 −0 src/ui/qgsrelationmanagerdialogbase.ui
@@ -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()
@@ -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>

0 comments on commit aaa3117

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