Skip to content
Permalink
Browse files

Show literal defaults in add feature form

  • Loading branch information
nyalldawson committed Nov 7, 2016
1 parent b0bd61f commit 94413c38fde960db4949f4ceb3d8c91ac01081a4
Showing with 11 additions and 1 deletion.
  1. +11 −1 src/app/qgsfeatureaction.cpp
@@ -176,7 +176,17 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
}
else
{
v = provider->defaultValueClause( idx );
QVariant defaultLiteral = mLayer->dataProvider()->defaultValue( idx );
if ( defaultLiteral.isValid() )
{
v = defaultLiteral;
}
else
{
QString defaultClause = provider->defaultValueClause( idx );
if ( !defaultClause.isEmpty() )
v = defaultClause;
}
}

mFeature->setAttribute( idx, v );

0 comments on commit 94413c3

Please sign in to comment.
You can’t perform that action at this time.