aboutsummaryrefslogtreecommitdiff
path: root/gui/src/addresstablemodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-06-02 17:48:45 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-06-02 17:56:51 +0200
commit44384a4602821216023ee63157ac6e376d1e9e10 (patch)
tree8820866d45114cdc0cec86fcde05a4fb80ff8317 /gui/src/addresstablemodel.cpp
parent5c94371f9a9bf41a5544403ee87ac331c2b0b1c3 (diff)
edit address dialog: basic data/widget binding
Diffstat (limited to 'gui/src/addresstablemodel.cpp')
-rw-r--r--gui/src/addresstablemodel.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/gui/src/addresstablemodel.cpp b/gui/src/addresstablemodel.cpp
index c375ca7555..1cacd08fee 100644
--- a/gui/src/addresstablemodel.cpp
+++ b/gui/src/addresstablemodel.cpp
@@ -95,10 +95,8 @@ QVariant AddressTableModel::data(const QModelIndex &index, int role) const
AddressTableEntry *rec = static_cast<AddressTableEntry*>(index.internalPointer());
- if(role == Qt::DisplayRole)
+ if(role == Qt::DisplayRole || role == Qt::EditRole)
{
- /* index.row(), index.column() */
- /* Return QString */
switch(index.column())
{
case Label:
@@ -126,6 +124,30 @@ QVariant AddressTableModel::data(const QModelIndex &index, int role) const
return QVariant();
}
+bool AddressTableModel::setData(const QModelIndex & index, const QVariant & value, int role)
+{
+ if(!index.isValid())
+ return false;
+
+ if(role == Qt::EditRole)
+ {
+ switch(index.column())
+ {
+ case Label:
+ /* TODO */
+ break;
+ case Address:
+ /* TODO */
+ /* Double-check that we're not overwriting receiving address */
+ /* Note that changing address changes index in map */
+ break;
+ }
+ /* emit dataChanged(index, index); */
+ return true;
+ }
+ return false;
+}
+
QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if(orientation == Qt::Horizontal)