Skip to content
Permalink
Browse files

allow changing attributes of added and not yet commited features

git-svn-id: http://svn.osgeo.org/qgis/trunk@8211 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 12, 2008
1 parent c65aee6 commit bd9f43f16ac5b5dbcf5090fdec1587abfad5c396
Showing with 28 additions and 15 deletions.
  1. +14 −7 src/app/qgsattributetable.cpp
  2. +10 −8 src/app/qgsattributetable.h
  3. +4 −0 src/app/qgsattributetabledisplay.h
@@ -32,7 +32,6 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"

#include <iostream>
#include <stdlib.h>

QgsAttributeTable::QgsAttributeTable(QWidget * parent, const char *name):
@@ -586,14 +585,22 @@ void QgsAttributeTable::storeChangedValue(int row, int column)
int id=text(row,0).toInt();
QString field = horizontalHeader()->label(column);

// add empty map for feature if doesn't exist
if (!mChangedValues.contains(id))
if(id>=0)
{
mChangedValues.insert(id, QMap<QString, QString>());
}
// add empty map for feature if doesn't exist
if (!mChangedValues.contains(id))
{
mChangedValues.insert(id, QMap<QString, QString>());
}

mChangedValues[id].insert(field, text(row,column));
mEdited=true;
mChangedValues[id].insert(field, text(row,column));
mEdited=true;
}
else
{
// added feature attribute changed
emit featureAttributeChanged(row,column);
}
}
}

@@ -104,15 +104,16 @@ class QgsAttributeTable:public Q3Table
/** Shows all rows */
void showAllRows();

public slots:
void columnClicked(int col);
void rowClicked(int row);
public slots:
void columnClicked(int col);
void rowClicked(int row);
// Called when the user requests a popup menu
void popupMenu(int row, int col, const QPoint& pos);
// Called when the user chooses an item on the popup menu
void popupItemSelected(QAction * menuAction);
protected slots:
void handleChangedSelections();

protected slots:
void handleChangedSelections();
/**Writes changed values to 'mChangedValues'*/
void storeChangedValue(int row, int column);

@@ -156,14 +157,15 @@ class QgsAttributeTable:public Q3Table
Also, mLastSelectedRows is updated*/
bool checkSelectionChanges();

signals:

signals:
/**Is emitted when a row was selected*/
void selected(int, bool);
/**Is emitted when all rows have been deselected*/
void selectionRemoved(bool);
/**Is emmited when a set of related selection and deselection signals have been emitted*/
/**Is emitted when a set of related selection and deselection signals have been emitted*/
void repaintRequested();
/**Is emitted when a attribute of a added feature is changed*/
void featureAttributeChanged(int row, int column);

private:
// Data to do with providing a popup menu of actions that
@@ -73,8 +73,12 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
void searchShowResultsChanged(int item);
void on_btnHelp_clicked();

public slots:
void changeFeatureAttribute(int row, int column);

signals:
void deleted();

private:
/** Set the icon theme for this dialog */
void setTheme();

0 comments on commit bd9f43f

Please sign in to comment.
You can’t perform that action at this time.