use user roles instead of hidden columns for model sort/filter keys

This commit is contained in:
Wladimir J. van der Laan
2011-05-22 19:32:37 +02:00
parent 858ff187f5
commit 8968bf2e36
6 changed files with 21 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
#include "addresstablemodel.h"
#include "main.h"
const QString AddressTableModel::Send = "S";
const QString AddressTableModel::Receive = "R";
@@ -16,7 +17,7 @@ int AddressTableModel::rowCount(const QModelIndex &parent) const
int AddressTableModel::columnCount(const QModelIndex &parent) const
{
return 3;
return 2;
}
QVariant AddressTableModel::data(const QModelIndex &index, int role) const
@@ -32,7 +33,7 @@ QVariant AddressTableModel::data(const QModelIndex &index, int role) const
return "1PC9aZC4hNX2rmmrt7uHTfYAS3hRbph4UN" + QString::number(index.row());
else
return "Description";
} else if (role == Qt::UserRole)
} else if (role == TypeRole)
{
switch(index.row() % 2)
{