<p dir="ltr">Hi !</p>
<p dir="ltr">Is it possible to change the query of a postgis query layer in python without reloading the project ?</p>
<p dir="ltr">The goal is to have a parameter in my query that I'd be able to change with a slider.</p>
<p dir="ltr">I tried the QgsVectorLayer.setDataSource() method, but it makes QGis crash.<br>
I tried the workaround described here (<a href="http://gis.stackexchange.com/questions/62610/changing-data-source-of-layer-in-qgis"> http://gis.stackexchange.com/questions/62610/changing-data-source-of-layer-in-qgis</a> ), writing and reading the XML file, but it also makes QGis crash.</p>
<p dir="ltr">If not possible, is there a serious limitation behind this, or is the feature just missing/bugged ?<br><br></p>
<p dir="ltr">Example :</p>
<p dir="ltr">I have this query loaded as a layer:</p>
<p dir="ltr">"SELECT id, name, ST_Buffer(geom,25) as geom FROM my_table"</p>
<p dir="ltr">But I want to be able to change the hardcoded buffer from 25 to some value from a QSlider.<br><br></p>
<p dir="ltr">Thanks!</p>
<p dir="ltr">Olivier </p>