I have identified a need to change VRTs raster order through its order of appearance in it's respective XML file. Unfortunately this seems to not be possible to do dynamically using QGIS commands or plugins.
So I'm thinking of developing a tool that detects a change to the map canvas then gets the center coordinate, finds the rasters in the VRT that are in view then reorders them in the XML file according to how close they are to the canvas center.
This seems very simple to do but I have no idea how to do eventing in the QGIS interface. Ideally this needs to be a background job that continually runs.
Are there any tutorials out there introducing one to eventing in QGIS Python?