mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
Show literal defaults in add feature form
This commit is contained in:
parent
b0bd61f308
commit
94413c38fd
@ -176,7 +176,17 @@ bool QgsFeatureAction::addFeature( const QgsAttributeMap& defaultAttributes, boo
|
|||||||
}
|
}
|
||||||
else
|
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 );
|
mFeature->setAttribute( idx, v );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user