mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
configurable set priority for card pictures
This commit is contained in:
parent
e0d773e4e5
commit
fb03c5cdbb
10 changed files with 242 additions and 17 deletions
37
cockatrice/src/setsmodel.h
Normal file
37
cockatrice/src/setsmodel.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef SETSMODEL_H
|
||||
#define SETSMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QMimeData>
|
||||
#include "carddatabase.h"
|
||||
|
||||
class SetsMimeData : public QMimeData {
|
||||
Q_OBJECT
|
||||
private:
|
||||
int oldRow;
|
||||
public:
|
||||
SetsMimeData(int _oldRow) : oldRow(_oldRow) { }
|
||||
int getOldRow() const { return oldRow; }
|
||||
QStringList formats() const { return QStringList() << "application/x-cockatricecardset"; }
|
||||
};
|
||||
|
||||
class SetsModel : public QAbstractTableModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
SetsModel(CardDatabase *_db, QObject *parent = 0);
|
||||
~SetsModel();
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &/*parent*/) const { return 2; }
|
||||
QVariant data(const QModelIndex &index, int role) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const;
|
||||
Qt::DropActions supportedDropActions() const;
|
||||
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const;
|
||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
|
||||
QStringList mimeTypes() const;
|
||||
private:
|
||||
SetList sets;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue