mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-27 00:53:55 -07:00
started implementing a simple deck editor
This commit is contained in:
parent
46a43aade4
commit
e6d6162426
13 changed files with 333 additions and 27 deletions
|
|
@ -4,6 +4,8 @@
|
|||
#include <QAbstractListModel>
|
||||
#include <QList>
|
||||
|
||||
class CardDatabase;
|
||||
|
||||
class DecklistRow {
|
||||
private:
|
||||
int number;
|
||||
|
|
@ -19,18 +21,20 @@ public:
|
|||
class DeckListModel : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
DeckListModel(QObject *parent = 0)
|
||||
: QAbstractListModel(parent) { }
|
||||
DeckListModel(CardDatabase *_db, QObject *parent = 0);
|
||||
~DeckListModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
void loadFromFile(const QString &fileName);
|
||||
bool loadFromFile(const QString &fileName);
|
||||
bool saveToFile(const QString &fileName);
|
||||
DecklistRow *getRow(int row) const;
|
||||
private:
|
||||
QList<DecklistRow *> deckList;
|
||||
void cleanList();
|
||||
private:
|
||||
CardDatabase *db;
|
||||
QList<DecklistRow *> deckList;
|
||||
void cacheCardPictures();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue