Skip to content

Commit aab2537

Browse files
committed
Merge attributes dialog: also skip pk attributes if taking attributes from selection
1 parent 42a3e38 commit aab2537

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/qgsmergeattributesdialog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ void QgsMergeAttributesDialog::createTableWidgetContents()
8484

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

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

486+
QSet<int> pkAttributes = mVectorLayer->pendingPkAttributesList().toSet();
486487
for ( int i = 0; i < mTableWidget->columnCount(); ++i )
487488
{
489+
if ( pkAttributes.contains( i ) )
490+
{
491+
continue;
492+
}
488493
QComboBox* currentComboBox = qobject_cast<QComboBox *>( mTableWidget->cellWidget( 0, i ) );
489494
if ( currentComboBox )
490495
{

0 commit comments

Comments
 (0)