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
wfs_vector_layer.dataProvider().updateExtents()
wfs_vector_layer.dataProvider().reloadData()
main_window.mapCanvas().refresh()
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?