[Qgis-developer] QgsFieldExpressionWidget return the results of the expression

matteo matteo.ghetta at gmail.com
Tue May 10 12:59:15 PDT 2016


Awesome!

Thanks for the tip!

This is the way I solved the problem (not sure if it is the best one, 
but it seems working):

if self.expField.currentField()[1] == False:
     for i in lay1.getFeatures():
         f1.append(i[lay1_f])
else:
     filter = self.expField.currentField()[0]
     exp = QgsExpression(filter)
     for i in lay1.getFeatures():
         f1.append(exp.evaluate(i, lay1.pendingFields()))


Thanks again!

Matteo


More information about the Qgis-developer mailing list