Adds a new method to QgsVectorDataProvider to truncate the layer.
The base implementation requires DeleteFeatures capability and
is not optimised. Providers can return the FastTruncate capability
and override the base implementation with a provider specific
optimised version. This is done in this commit for the Postgres
and Spatialite providers.
Previously this method would only succeed for providers which
explicitly implement it. Now, providers which do not implement
changeFeatures but do support both ChangeAttributeValues
and ChangeGeometries capabilities will use a non-optimised
version of changeFeatures which calls changeAttributeValues
and changeGeometries in turn.
This makes QgsVectorDataProvider::changeFeatures easier to use
in scripts - instead of writing manual fallbacks for providers
which do not implement it you can instead safely call this
method regardless of the provider and it will succeed wherever
both the attributes/geometries can be changed.
Also add a provider unit test covering this.
Fixes https://github.com/qgis/QGIS/pull/3871#commitcomment-20280621, ie switching between
renderers in the raster layer properties dialog or in the style dock result in non optimal
parameters, so better switch to default parameters that would be the ones used when
adding a layer of the new renderer type to the canvas. This issue already existed in 2.18
Also fixes a potential infinite notification cycle when having both the style dock and
layer properties dialog opened, and applying changes in the layer properties dialog.
(related to https://github.com/qgis/QGIS/pull/3871).
This adds a new gui widget QgsFieldValuesLineEdit which includes
an autocompleter populated with current field values.
The autocompleter is nicely updated in the background so that
the gui remains nice and responsive, even if there's millions
of records in the associated table.
It's now used as a search widget for text fields, so can be seen
in the browser window if you set the filter to a text field, or
if you launch the form based select/filter by selecting a layer
and pressing F3.