Skip to content

Commit 5f1ed35

Browse files
committed
Merge pull request #1932 from ccrook/Field_calculator_expression_fix
Fix #12257 - allow creation of expression field on delimited text layer
2 parents 1cce091 + 9c2f572 commit 5f1ed35

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/qgsfieldcalculator.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ void QgsFieldCalculator::accept()
158158
return;
159159
}
160160

161-
if ( mNewFieldGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
161+
// Test for creating expression field based on ! mUpdateExistingGroupBox checked rather
162+
// than on mNewFieldGroupBox checked, as if the provider does not support adding attributes
163+
// then mUpdateExistingGroupBox is set to not checkable, and hence is not checked. This
164+
// is a minimum fix to resolve this - better would be some GUI redesign...
165+
if ( ! mUpdateExistingGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() )
162166
{
163167
mVectorLayer->addExpressionField( calcString, fieldDefinition() );
164168
}

0 commit comments

Comments
 (0)