Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-15 Thread Zhang Qun
it's QgsEditException. The edit(layer) statement is working just fine. On Thu, Jun 14, 2018, 8:11 PM Thomas Baumann wrote: > Hello, > isnt it "QgsEditError" instead of "QgsEditException"? > > regards, > Thomas > > > Am Do., 14. Juni 2018 um 03:26 Uhr schrieb Zhang Qun >: > >> Hi Matthias >> >>

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-14 Thread Thomas Baumann
Hello, isnt it "QgsEditError" instead of "QgsEditException"? regards, Thomas Am Do., 14. Juni 2018 um 03:26 Uhr schrieb Zhang Qun : > Hi Matthias > > I follow the steps in the link you posted and get the following errors > when trying to import > > ImportError: cannot import name

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Zhang Qun
Hi Matthias I follow the steps in the link you posted and get the following errors when trying to import ImportError: cannot import name QgsEditException Do I have to install some modules? Didn't find any luck on google. Best regards, Zhang Qun On Wed, Jun 13, 2018 at 6:16 PM, Matthias Kuhn

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Zhang Qun
Thanks Matthias. Got it. I was just trying to not flood messages to those pals who may not be interested. Best regards, Ethan On Wed, Jun 13, 2018 at 6:16 PM, Matthias Kuhn wrote: > Glad you like it :) > > Forwading this answer also to the mailing list for future reference, > Ethan, you need

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Matthias Kuhn
Glad you like it :) Forwading this answer also to the mailing list for future reference, Ethan, you need to use "reply to all" in your mail application or other are not able to follow our conversation (which would be a pity ;) ). Best regards Matthias On 06/13/2018 12:13 PM, Zhang Qun wrote: >

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Matthias Kuhn
Hi Ethan, there are of course advantages and disadvantages of both methods, but in most cases the QgsVectorLayer ones just "do the right thing", especially when used with a `with` block, see also this post: http://www.opengis.ch/2015/08/12/with-edit-layer/ Cheers Matthias On 06/13/2018 11:59

Re: [QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Matthias Kuhn
Hi Ethan On 06/13/2018 11:18 AM, Zhang Qun wrote: > Hi everyone, i"m using QGIS2.18, and trying to change feature attributes > using the following two methods: > > *dataProvider:* > > |attrs ={0:"hello",1:123}layer.dataProvider().changeAttributeValues({fid > :attrs })| > > *layer object:* > >

[QGIS-Developer] reload attribute table does not work for attribute changed by dataProvider

2018-06-13 Thread Zhang Qun
Hi everyone, i"m using QGIS2.18, and trying to change feature attributes using the following two methods: *dataProvider:* attrs = { 0 : "hello", 1 : 123 } layer.dataProvider().changeAttributeValues({ fid : attrs }) *layer object:* layer.startEditing() layer.changeAttributeValue(fid,