Skip to content

Commit

Permalink
Keep role in sync
Browse files Browse the repository at this point in the history
Fixes #37659
  • Loading branch information
pblottiere committed Sep 29, 2020
1 parent 8d2a0d1 commit ac4132e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/qgsmergeattributesdialog.cpp
Expand Up @@ -324,6 +324,7 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )
const int fieldIdx = mTableWidget->horizontalHeaderItem( col )->data( FieldIndex ).toInt();

//evaluate behavior (feature value or min / max / mean )
QTableWidgetItem *item = mTableWidget->item( mTableWidget->rowCount() - 1, col );
const QString mergeBehaviorString = comboBox->currentData().toString();
QVariant mergeResult; // result to show in the merge result field
if ( mergeBehaviorString == QStringLiteral( "concat" ) )
Expand All @@ -336,7 +337,7 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )
}
else if ( mergeBehaviorString == QLatin1String( "manual" ) )
{
return; //nothing to do
mergeResult = item->data( Qt::DisplayRole );
}
else if ( mergeBehaviorString.startsWith( 'f' ) )
{
Expand All @@ -353,7 +354,6 @@ void QgsMergeAttributesDialog::refreshMergedValue( int col )

//insert string into table widget
mUpdating = true; // prevent combobox changing to "manual" value
QTableWidgetItem *item = mTableWidget->item( mTableWidget->rowCount() - 1, col );

// Result formatting
QString stringVal;
Expand Down Expand Up @@ -559,6 +559,7 @@ void QgsMergeAttributesDialog::tableWidgetCellChanged( int row, int column )
currentComboBox->blockSignals( true );
currentComboBox->setCurrentIndex( currentComboBox->findData( QStringLiteral( "manual" ) ) );
currentComboBox->blockSignals( false );
refreshMergedValue( column );
}
}

Expand Down

0 comments on commit ac4132e

Please sign in to comment.