Added data(FullNameRole) implementation and minor refactoring.
This commit is contained in:
@ -82,11 +82,14 @@ QVariant TableModel::data(const QModelIndex& index, int role) const {
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
int roleForColumn = GET_ROLE_FOR_COLUMN(column);
|
||||
const int roleForColumn = GET_ROLE_FOR_COLUMN(column);
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
case Qt::EditRole:
|
||||
return m_items.at(row)->data(roleForColumn);
|
||||
case Qt::ToolTipRole:
|
||||
return m_items.at(index.row())->data(ToStringRole);
|
||||
break;
|
||||
case MembershipNumberRole:
|
||||
case LastNameRole:
|
||||
case FirstNameRole:
|
||||
@ -102,11 +105,9 @@ QVariant TableModel::data(const QModelIndex& index, int role) const {
|
||||
case BiddingTypeRole:
|
||||
case OnlineIdRole:
|
||||
case AccessCodeRole:
|
||||
return m_items.at(row)->data(role);
|
||||
case ToStringRole:
|
||||
return m_items.at(row)->toString();
|
||||
case JsonObjectRole:
|
||||
return m_items.at(row)->toJsonObject();
|
||||
return m_items.at(row)->data(role);
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
||||
Reference in New Issue
Block a user