Skip to content

Commit 3737aef

Browse files

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed
 

‎src/app/qgsattributetabledisplay.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ QgsAttributeTableDisplay::QgsAttributeTableDisplay(QgsVectorLayer* layer, QgisAp
6060
connect(mSearchShowResults, SIGNAL(activated(int)), this, SLOT(searchShowResultsChanged(int)));
6161
connect(btnAdvancedSearch, SIGNAL(clicked()), this, SLOT(advancedSearch()));
6262
connect(btnClose, SIGNAL(clicked()), this, SLOT(close()));
63-
63+
connect(tblAttributes, SIGNAL(featureAttributeChanged(int,int)), this, SLOT(changeFeatureAttribute(int,int)));
64+
6465
//disable those buttons until start editing has been pressed and provider supports it
6566
mAddAttributeButton->setEnabled(false);
6667
mDeleteAttributeButton->setEnabled(false);
@@ -407,3 +408,19 @@ void QgsAttributeTableDisplay::showHelp()
407408
{
408409
QgsContextHelp::run(context_id);
409410
}
411+
412+
void QgsAttributeTableDisplay::changeFeatureAttribute(int row, int column)
413+
{
414+
QgsFeatureList &flist = mLayer->addedFeatures();
415+
416+
int id = table()->text(row,0).toInt();
417+
418+
int i;
419+
for(i=0; i<flist.size() && flist[i].featureId()!=id; i++)
420+
;
421+
422+
if(i==flist.size())
423+
return;
424+
425+
flist[i].changeAttribute(column-1, table()->text(row,column));
426+
}

0 commit comments

Comments
 (0)
Please sign in to comment.