With an CSV layer Qgis workspace [loaded as a delimited text layer], an external algorithm is ran; outputting (writing) new values to certain rows in the layers source CSV file.
The writing works properly (CSV can be opened in text editor immediately after ext. process to show the correct values in question), yet a problem arises in the Qgis updates. The changed values; when viewed in the attribute table depict a 'NULL' value.
Although removing and reloading the layer properly updates the attribute table, I would like to avoid such; as important temp. display-label data / settings needs to be retained.[Possibly the only option?]
I have tested the following scripts without resolve:
csvDelimTextLayer.reload()
csvDelimTextLayer.updateFields()
iface.legendInterface().refreshLayerSymbology(csvDelimTextLayer)
iface.mapCanvas().refresh()
Spending some more time revealed the following work-flow:
-The algorithm which updates the CSV is activated
<p>-The updates only show a 'NULL' value in the attribute table</p> <p>-Immediately after confirming 'NULL's, save project and close QGIS</p> <p>-Upon reopening the QGIS and the project, the proper data is displayed. Additionally (and perhaps most importantly) now every time the algorithm is ran - the reflected changes (and values) are properly viewable in the attribute table without having to resave and restart QGis.</p>
Does this indicate an error or missing step in my initial method of allocating data in PyQgis when writing and loading the CSV; which upon saving and restarting QGis is fulfilled?
reloadmethod that doesn't seem to work. Anyways, that's the solution. – Germán Carrillo Feb 17 '15 at 12:51