When a filter is applied to a layer the layer cannot be edited. Is there any way of quickly turning the filter on or off without entering the Query Builder dialog box and removing the filter?
Asked
Active
Viewed 2,015 times
1
-
2You can also get around this by using a rule-based renderer, or use a SpatiaLite layer which allows editing while a filter is applied. See http://gis.stackexchange.com/questions/32533/is-it-possible-to-edit-a-layer-in-qgis-while-there-is-an-active-query for more. – rudivonstaden Nov 20 '14 at 08:04
2 Answers
2
Currently no but there is a feature request for it (will update when I find it)
Nathan W
- 34,706
- 5
- 97
- 148
-
It would be a handy feature to add. Currently it's a little cumbersome, for example if I want to move a label I need to remove the filter, edit, and then reapply the filter. A simple tick box would work, and if it could be attached to the filter selection in the drop down list when right clicking on a layer that would be ideal. – Geezer Jul 01 '14 at 22:47
0
You could maybe play with an URI change (QgsDataSourceURI()).
URI from a shapefile layer is made like this (for example) : \\MYPATH\MYLAYER.shp|layerid=0|subset="COLUMN" = 'ATTRIBUTE'
You could imagine the following workflow maybe :
CLICK :
- Get the URI
- Store then remove the end from the pipe sign (|) to the end of the URI
- Reload the datasource
CLICK AGAIN:
- Get the URI
- Add the filter stored previously
- Reload the datasource
I realise it's not the best solution, but it's a try. You could also use the changedatasource plugin to go faster and remove a filter with a right click on the layer.
gisnside
- 7,818
- 2
- 29
- 73