In a QGIS python plugin. I like to change value selected cell in qtablewidget to the typed value. Something like screenshot below.
But in changeattributevalue function. While column(second value) and string(third value) is really easy to get. I really can't find a way to get "QgsFeatureId"(first value) with row and columns of qtablewidget.
If I do something like below. It will always change wrong row.
layer.changeAttributeValue(long(table.selectedIndexes().row()), table.selectedIndexes().column(), changestring.text())
I tried to use QgsFeatureRequest() with unique column field, but I really don't know how to use this function with variables and scanning whole table seems ununnecessary.
request = QgsFeatureRequest().setFilterExpression( u' header[table.selectedIndexes().column()] = table_data[table.selectedIndexes().row()]' ))
Is there any way to get QgsFeatureId based on row number?