Merge pull request #2021 from ZeldaZach/color_list

Colors to deck editor
This commit is contained in:
ctrlaltca 2016-07-05 14:45:09 +02:00 committed by GitHub
commit 07bc215b3e
2 changed files with 4 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#include "carddatabasemodel.h"
#include "filtertree.h"
#define CARDDBMODEL_COLUMNS 5
#define CARDDBMODEL_COLUMNS 6
CardDatabaseModel::CardDatabaseModel(CardDatabase *_db, QObject *parent)
: QAbstractListModel(parent), db(_db)
@ -44,6 +44,7 @@ QVariant CardDatabaseModel::data(const QModelIndex &index, int role) const
card->getManaCost();
case CardTypeColumn: return card->getCardType();
case PTColumn: return card->getPowTough();
case ColorColumn: return card->getColors().join("");
default: return QVariant();
}
}
@ -60,6 +61,7 @@ QVariant CardDatabaseModel::headerData(int section, Qt::Orientation orientation,
case ManaCostColumn: return QString(tr("Mana cost"));
case CardTypeColumn: return QString(tr("Card type"));
case PTColumn: return QString(tr("P/T"));
case ColorColumn: return QString(tr("Color(s)"));
default: return QVariant();
}
}

View file

@ -12,7 +12,7 @@ class FilterTree;
class CardDatabaseModel : public QAbstractListModel {
Q_OBJECT
public:
enum Columns { NameColumn, SetListColumn, ManaCostColumn, PTColumn, CardTypeColumn, CMCColumn };
enum Columns { NameColumn, SetListColumn, ManaCostColumn, PTColumn, CardTypeColumn, ColorColumn };
enum Role { SortRole=Qt::UserRole };
CardDatabaseModel(CardDatabase *_db, QObject *parent = 0);
~CardDatabaseModel();