Skip to content

Commit

Permalink
[fix #6] also take client side default values into account
Browse files Browse the repository at this point in the history
for reach digitizing in wizard
take first client default values then provider default values
  • Loading branch information
3nids committed Jan 29, 2018
1 parent 112036d commit 6490d10
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tools/qgepmaptooladdfeature.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
QgsTolerance,
QgsFeatureRequest,
QGis,
QgsGeometry
QgsGeometry,
NULL
)
from PyQt4.QtGui import (
QCursor,
Expand Down Expand Up @@ -231,7 +232,12 @@ def rightClicked(self, _):
fields = self.layer.fields()
f = QgsFeature(fields)
for idx in range(len(fields)):
f.setAttribute(idx, self.layer.dataProvider().defaultValue(idx))
# try client side default value first
v = self.layer.defaultValue( idx, f )
if v != NULL:
f.setAttribute(idx, v)
else:
f.setAttribute(idx, self.layer.dataProvider().defaultValue(idx))

f.setGeometry(self.rubberband.asGeometry())

Expand Down

0 comments on commit 6490d10

Please sign in to comment.