[QGIS-Developer] random order after open attribute table

Martin Landa landa.martin at gmail.com
Sat Mar 2 05:14:20 PST 2019


Hi,

I found problem with strange row ordering after opening attribute
table in QGIS3. Rows are not ordered correctly (how related features
were written to a layer). In example [1] rows should be ordered
staring with 0. I am getting correct order after pressing 'Reload the
table' [2]. Unfortunately adding code below after loading data in a
plugin

layer.dataProvider().forceReload()

has no effect, rows are still not ordered correctly. I didn't have
such problem with QGIS2, it's seems to be new behaviour. Any idea?

Related question: is it possible to defined for vector layer using
Python API specific field used for default row ordering when opening
attribute table?

Thanks, Martin

[1] http://geo102.fsv.cvut.cz/~landa/tmp/random_open_sorting.png
[2] http://geo102.fsv.cvut.cz/~landa/tmp/correct_order_after_reload.png

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa


More information about the QGIS-Developer mailing list