In very simple beginners terms... how do I refresh the QGIS map canvas (or a specific named layer) as part of a processing script?
I have an extremely simple processing script (below) set up just to make it really easy to change a project variable. One of my map layers has a conditional styling rule set up based on the project variable. After running the script I currently have to manually refresh the canvas (by clicking the refresh button or moving the canvas) to update the map display. For purposes of simple elegance and efficiency I'd like the script to do this automatically.
Please answer in the simplest terms - I'm well out of my depth here.
The script is as follows:
##variable_for_styling=number 0 from qgis.core import * from PyQt4.QtCore import * QgsExpressionContextUtils.setProjectVariable( 'NameOfMyProjectVariable', variable_for_styling )