I have a wfs layer loaded in a standalone QGIS app, which I am updating by running a database query on the view it is based on. The feature is added with no problems and I reload the layer with:

# Runs insert query here to add feature to WFS layer source table

However, the refresh() does not visibly update the canvas, and I have to pan or zoom the canvas to get it to redraw the updated wfs layer with the new feature. I can't see anything more than a refresh() happening after panning from the qgsmaptoolpan source code. Am I using the method incorrectly?

1 Answer 1


Solved it with:


From this answer: How to automatically reload raster layers if source is changed in QGIS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.