Skip to content

Commit ee68332

Browse files
committed
Suppress attribute form popup if layer has no fields
Prevents empty form popup for layers with no fields (eg memory layers). If desired, this behaviour can be overriden by the layer's feature form suppress option, eg if form has python logic which makes it useful even with no fields. (fix #10775)
1 parent c3c945b commit ee68332

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/app/qgsfeatureaction.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
163163
mFeature.setAttribute( idx, v );
164164
}
165165

166-
// show the dialog to enter attribute values
167-
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
166+
//show the dialog to enter attribute values
167+
//only show if enabled in settings and layer has fields
168+
bool isDisabledAttributeValuesDlg = ( fields.count() == 0 ) || settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
169+
168170
// override application-wide setting with any layer setting
169171
switch ( mLayer->featureFormSuppress() )
170172
{

0 commit comments

Comments
 (0)