Skip to content
Permalink
Browse files
Merge attributes dialog: also skip pk attributes if taking attributes…
… from selection
  • Loading branch information
mhugent committed Jul 8, 2013
1 parent 42a3e38 commit aab2537eb4c4fd457551f6d61d52796e91a88bc5
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/app/qgsmergeattributesdialog.cpp
@@ -84,7 +84,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()

//create combo boxes and insert attribute names
const QgsFields& fields = mVectorLayer->pendingFields();
QgsAttributeList pkAttrList = mVectorLayer->pendingPkAttributesList();
QSet<int> pkAttrList = mVectorLayer->pendingPkAttributesList().toSet();

int col = 0;
for ( int idx = 0; idx < fields.count(); ++idx )
@@ -483,8 +483,13 @@ void QgsMergeAttributesDialog::on_mFromSelectedPushButton_clicked()
return;
}

QSet<int> pkAttributes = mVectorLayer->pendingPkAttributesList().toSet();
for ( int i = 0; i < mTableWidget->columnCount(); ++i )
{
if ( pkAttributes.contains( i ) )
{
continue;
}
QComboBox* currentComboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, i ) );
if ( currentComboBox )
{

0 comments on commit aab2537

Please sign in to comment.