Hi Devs,
I'm trying to change the dataSourceUri of an existing layer, but can't
get it working. The reason is that my layer should be connected to
another view in the same database, because the db should do some
calculations for my plugin.
I created a test script for a simple polygon layer i
Hi,
dataSourceUri is used when creating the dataProvider/vectorlayer and
there is no way to refresh the provider according to a new uri.
I don't see any other way than recreate a new QgsVectorLayer with the
new dataSource uri, add it to your project instance with addMapLayer and
remove the old
*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/
I'm trying to change the dataSourceUri of an existing layer
Hi Raymond,
AFAIK you need to use setDataSource [1] directly on the layer an not
setDataSourceUri on the data prov
Thanks Andrea, but that doesn't seem to exist:
AttributeError: 'QgsVectorLayer' object has no attribute 'setDataSourceUri'
Raymond
On 08-12-2022 19:42, Andrea Giudiceandrea via QGIS-Developer wrote:
*Raymond Nijssen*
/Wed Dec 7 07:39:50 PST 2022/
--
Hi Raymond,
I wrote setDataSource, not setDataSourceUri.
Regards.
Andrea
Il 09/12/2022 08:19, Raymond Nijssen via QGIS-Developer ha scritto:
Thanks Andrea, but that doesn't seem to exist:
AttributeError: 'QgsVectorLayer' object has no attribute
'setDataSourceUri'
Raymond
On 08-12-2022 1
That works!! :O
Thank you so much!!!
Raymond
On 09-12-2022 08:20, Andrea Giudiceandrea via QGIS-Developer wrote:
Hi Raymond,
I wrote setDataSource, not setDataSourceUri.
Regards.
Andrea
Il 09/12/2022 08:19, Raymond Nijssen via QGIS-Developer ha scritto:
Thanks Andrea, but that doesn't see