[QGIS-Developer] Default QgsFeatureFid ?

Sandro Santilli strk at kbt.io
Fri Oct 15 01:34:48 PDT 2021


While writing unit test for QgsFeatureRequest in core I found
that the filterFid() method for the default-constructed
QgsFeatureRequest returns -1 rather than what a default-constructed
QgsFeatureId() would return (0)

So I've been wondering: *should* a QgsFeatureFid have a default
value of -1 instead ? More generically: does QGIS make any assumption
about *which* special value of QgsFeatureFid means "no fid" ?

If there's no such notion as an "unspecified FID" then I wonder
why QgsFeatureRequest is taking the effort of specifying a default
value of it different from the default, and if there's a good reason
it should probably be documented there.

--strk; 

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html


More information about the QGIS-Developer mailing list